ModulenotFoundError:No模块名为' mysql'尽管多次尝试解决
我似乎还是不断面对这个错误
- :通过“ Python -M PIP安装MySQL-Connector-Python”
- 安装MySQL软件包,
尽管以下内容 “每次我在终端再次运行它时已经满足需求”。此外,我也尝试安装和重新安装包装。
但是所有结果都是相同的。每次运行脚本并尝试“导入mysql.connector”时,我总是会得到ModulenotFoundError:没有名为'MySQL'错误的模块
都会非常感谢您的帮助。非常感谢
I seem to be facing this error continuously despite:
- Installing the mysql-connector via "python -m pip install mysql-connector-python"
- Installing the MySQL package via "pip install MySQL"
I have confirmed that I have installed the package as it says "Requirement already satisfied everytime I run it again in the terminal". Additionally, I have tried installing and reinstalling the package as well.
But all the results are the same. Each time I run my script and try to "import mysql.connector", I always get the ModuleNotFoundError: No module named 'mysql' error
Would greatly appreciate some help. Thank you very much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您使用虚拟环境吗?如果是虚拟环境,请将虚拟环境的扩展软件包文件夹中的内容复制到Python下的软件包文件夹。
如果您的系统中有两个版本的Python,则可能会遇到此问题。 “ Ctrl+Shift+P”,然后选择正确的解释器。
您可以使用以下方法检查并查看PIP安装的软件包:
Do you use virtual environments? If it is a virtual environment, please copy the contents in the expansion package folder of the virtual environment to the package folder under python.
If you have two versions of Python in your system, you may also encounter this problem. "CTRL+SHIFT+P" and choose the correct interpreter.
You can use the following method to check and see where pip installed the package: