文章内容
2019/11/22 15:04:35,作 者: 黄兵
ImportError: No module named MySQLdb
今天在使用Python操作MySQL数据库的时候,使用的是MySQLdb,如果你使用pip install MySQLdb
,大部分是安装不成功的。
主要报错内容如下:
Collecting MySQLdb
Could not find a version that satisfies the requirement MySQLdb (from versions: )
No matching distribution found for MySQLdb
需要安装mysqlclient,具体命令如下:
pip install mysqlclient
如果在安装过程中包timeout,需要代理,我这边安装了几次都是timeout错误,全局代理之后问题解决。
Windows 10下安装mysqlclient 1.4.6
无任何问题。
下面是截图:
黄兵个人博客原创。
评论列表