Python2 安装MySQLdb库

今天爬了半天坑,终于在windows上安装好了python2的MySQLdb库,直接使用cmd命令安装就会遇到各种报错

python.exe -m pip install mysqlclient==1.3.12


然后去https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python这个网站上下源文件,先去检查一下自己是什么系统,然后下载对于的32位或者64位文件

根据文件位置运行一下安装命令,然后就安装好了

E:\seven>test\Scripts\python.exe -m pip install test\MySQL_python-1.2.5-cp27-none-win_amd64.whl
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Processing e:\seven\test\mysql_python-1.2.5-cp27-none-win_amd64.whl
Installing collected packages: MySQL-python
Successfully installed MySQL-python-1.2.5

猜你喜欢

转载自blog.csdn.net/weixin_41407477/article/details/88951226