简体   繁体   中英

What is the reason of ModuleNotFoundError: No module named 'mysql' in Python 3.8.10 and Requirement already satisfied in anaconda location problem?

I need to import mysql-connector and I installed it by using pip install mysql-connector-python . After the installation, I can see the same error is displayed.

源代码

错误图像 - ModuleNotFoundError: 没有名为“mysql”的模块

After that again I tried to install mysql connector, but it displayed that Requirement already satisfied and show a path in anaconda lib folder.

已经存在

Is there any effect from previous installation on Anaconda and how to import mysql-connector to code?

As a solution for that, I changed the interpreter of the code into ('base': conda) . It worked correctly without any error.

解决方案_更改解释器

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM