我已经mysql-python在我的机器(Windows 8)上安装了v1.2.4。我正在使用Python 2.7。每当我尝试升级到v1.2.5时,总是会收到以下错误消息。(从v1.3.7开始仍然发生)
mysql-python
C:\Users\User\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\ 9.0 \ VC \ Bin \ cl.exe / c / nologo / Ox / MD / W3 / GS- / DNDEBUG -Dversion_info =(1,2,5,’final’,1)-D__version __ = 1.2.5“ -IC :\ Program Files(x86)\ MySQL \ MySQL Connector C 6. 0.2 \ include“ -Ic:\ python27 \ include -Ic:\ python27 \ PC /Tc_mysql.c /Fobuild\temp.wi n32-2.7 \ Release_mysql.obj / Zl _mysql.c _mysql.c(42):致命错误C1083:无法打开包含文件:’config- win.h’:没有此类文件或目录错误:命令’C:\ Users \ User \ AppData \ Local \ Programs \ Common \ Microsoft \ Visual C ++ for Python \ 9.0 \ VC \ Bin \ cl.exe’失败,退出状态为2 ---------------------------------------- Rolling back uninstall of mysql-python Command “c:\python27\python.exe -u -c “import setuptools,标记化; 文件 =’c:\\ users \ user \ appdata \ local \ temp \ pip- build-utz7of \ MySQL-python \ setup.py’;例如ec(compile(getattr(tokenize,’open’,open)( file ) .read()。replace(’\ r \ n’,’\ n’), file ,’exec’))“安装–record c:\ users \ user \ appdata \ local \ temp \ pip-osy _cg- record \ install- record.txt-“单一版本-外部管理-编译” fai在c:\ users \ user \ appdata \ local \ temp \ pip-build-utz7of \ MySQL -python \中导致错误代码1
C:\Users\User\AppData\Local\Programs\Common\Microsoft\Visual C++ for
Python\
9.0 \ VC \ Bin \ cl.exe / c / nologo / Ox / MD / W3 / GS- / DNDEBUG -Dversion_info =(1,2,5,’final’,1)-D__version __ = 1.2.5“ -IC :\ Program Files(x86)\ MySQL \ MySQL Connector C 6. 0.2 \ include“ -Ic:\ python27 \ include -Ic:\ python27 \ PC /Tc_mysql.c /Fobuild\temp.wi n32-2.7 \ Release_mysql.obj / Zl _mysql.c _mysql.c(42):致命错误C1083:无法打开包含文件:’config- win.h’:没有此类文件或目录错误:命令’C:\ Users \ User \ AppData \ Local \ Programs \ Common \ Microsoft \ Visual C ++ for Python \ 9.0 \ VC \ Bin \ cl.exe’失败,退出状态为2
---------------------------------------- Rolling back uninstall of
mysql-python Command “c:\python27\python.exe -u -c “import
setuptools,标记化; 文件 =’c:\\ users \ user \ appdata \ local \ temp \ pip- build-utz7of \ MySQL-python \ setup.py’;例如ec(compile(getattr(tokenize,’open’,open)( file ) .read()。replace(’\ r \ n’,’\ n’), file ,’exec’))“安装–record c:\ users \ user \ appdata \ local \ temp \ pip-osy _cg- record \ install- record.txt-“单一版本-外部管理-编译” fai在c:\ users \ user \ appdata \ local \ temp \ pip-build-utz7of \ MySQL -python \中导致错误代码1
我已经尝试过了(没有任何工作):
Failed building wheel for MySQL-python
mysqlclient
我想念什么吗?谢谢。
我自己解决了。
我从http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql- python使用了车轮安装程序。
那里有两个车轮套件。在amd64一个拒绝安装我的平台(Windows)上,但另外一个作品就好。我的意思是该文件具有以下名称:
amd64
MySQL_python-1.2.5-cp27-none-win32.whl
然后通过在wheel包所在的同一文件夹中运行以下命令来安装它。
pip install MySQL_python-1.2.5-cp27-none-win32.whl
Python 3.7
采用 mysqlclient‑1.3.13‑cp37‑cp37m‑win32.whl
mysqlclient‑1.3.13‑cp37‑cp37m‑win32.whl