pyCharm提示No module named ‘MySQLdb‘
程序员文章站
2022-05-28 23:40:28
...
文章目录
异常
在运行一个py程序时,提示No module named 'MySQLdb'
解决办法
在cmd
中直接安装mysqlclient
,当然这个项目我选择的是使用系统的python编译器
C:\Users\lenovo>pip3 install mysqlclient
Collecting mysqlclient
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)")': /packages/4a/28/b08ede6cc8382179201455c3b9e5ed0d66aa5921e7c1888828dba48b832b/mysqlclient-2.0.1-cp37-cp37m-win_amd64.whl
Downloading mysqlclient-2.0.1-cp37-cp37m-win_amd64.whl (268 kB)
|████████████████████████████████| 268 kB 1.9 kB/s
Installing collected packages: mysqlclient
Successfully installed mysqlclient-2.0.1
安装到哪了
通过上述方式安装的依赖包,可以在python_home
下的Lib/site-packages
目录下找到
如,我的安装在以下位置
D:\Program Files\Python37\Lib\site-packages\mysqlclient-2.0.1.dist-info
Windows看监听的端口
程序运行后会监听一个端口,在cmd中可以用下面的命令查看监听情况
C:\Users\lenovo>netstat -ano | findstr 22707
TCP 0.0.0.0:22707 0.0.0.0:0 LISTENING 5472
参考博客
https://blog.csdn.net/qq_769932247/article/details/88188945
https://blog.csdn.net/sophie1314/article/details/103502821
上一篇: Cmake命令行-G 和 -D
推荐阅读
-
python提示No module named images的解决方法
-
解决Python源码编译时提示:ModuleNotFoundError: No module named ‘distutils.command‘
-
pycharm运行出现ImportError:No module named的解决方法
-
Django重装mysql后启动报错:No module named ‘MySQLdb’的解决方法
-
PyCharm导入pymysql包运行报错问题解决:No module named 'PyMySQL'
-
解决pycharm终端/cmd运行python脚本报错“ImportError/ModuleNotFoundError:No Module named ...”
-
Linux云服务ModuleNotFoundError: No module named 'MySQLdb'
-
Pycharm配置Flask无法启动,报No module named flask.__main__; ‘flask‘ is a package and cannot be direct
-
Pycharm调Anaconda安装的库,试坑:"No module named numpy"
-
PyCharm提示ModuleNotFoundError: No module named 'pymysql'