文章目录
- 异常
- 解决办法
- 安装到哪了
- 参考博客
异常
在运行一个py程序时,提示No module named 'MySQLdb'
解决办法
在cmd
中直接安装mysqlclient
,当然这个项目我选择的是使用系统的python编译器
C:\Users\lenovo>pip3 install mysqlclient
Collecting mysqlclientWARNING: 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.whlDownloading 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
参考博客
https://blog.csdn.net/qq_769932247/article/details/88188945
https://blog.csdn.net/sophie1314/article/details/103502821