无法在Windows中安装mysql-python(新版本) [英] Can't install mysql-python (newer versions) in Windows

查看:114
本文介绍了无法在Windows中安装mysql-python(新版本)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的计算机(Windows 8)上已经安装了mysql-python v1.2.4.我正在使用Python 2.7.每当我尝试升级到v1.2.5时,我总是会收到以下错误消息. (从v1.3.7开始仍然发生)

I have mysql-python v1.2.4 installed just fine on my machine (Windows 8). I am using Python 2.7. I always got this below error every time I try to upgrade to v1.2.5. (still happens as of v1.3.7)

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 用于Python \ 9.0 \ VC \ Bin \ cl.exe的C ++失败,退出状态为2

9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'fi nal',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) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory error: command 'C:\Users\User\AppData\Local\Programs\Common\Microsoft \Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 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', 打开)(文件).read().replace('\ r \ n','\ n'),文件,'exec')) 安装--record c:\ users \ user \ appdata \ local \ temp \ pip-osy _cg-record \ install-record.txt --single-version-externally-managed --compile"fai在c:\ users \ user \ appdata \ local \ temp \ pip-build-utz7of \ MySQL中导致错误代码1 -python \

setuptools, tokenize;file='c:\ \users\user\appdata\local\temp\pip-build-utz7of\MySQL-python\setup.py';ex ec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n' ), file, 'exec'))" install --record c:\users\user\appdata\local\temp\pip-osy _cg-record\install-record.txt --single-version-externally-managed --compile" fai led with error code 1 in c:\users\user\appdata\local\temp\pip-build-utz7of\MySQL -python\

我已经尝试过(但无济于事):

I've tried (and none work):

  1. 安装VS2010
  2. 更改Python路径
  3. 使用Wheel模块(我得到了Failed building wheel for MySQL-python)
  4. 安装Python MySQL连接器.对于Python和C.
  5. 安装mysqlclient
  6. https://pypi.python.org/中使用Exe安装程序进行安装pypi/mysql-python/1.2.5
  1. Installing VS2010
  2. Changing Python Path
  3. Using Wheel module (I got Failed building wheel for MySQL-python)
  4. Installing Python MySQL connector. For both Python and C.
  5. Installing mysqlclient
  6. Installing using Exe installer from https://pypi.python.org/pypi/mysql-python/1.2.5

我想念什么吗?谢谢.

推荐答案

我自己解决了.

我从 http://www.lfd使用车轮安装程序. uci.edu/~gohlke/pythonlibs/#mysql-python .

那里有两个车轮包装. amd64一个拒绝在我的平台(Windows)上安装,但另一个可以正常工作.我的意思是该文件名为:

There are two wheel packages there. The amd64 one refuses to install on my platform (Windows) but the other one works just fine. I mean the file with this name:

MySQL_python-1.2.5-cp27-none-win32.whl

然后通过在wheel包的同一文件夹中运行以下命令来安装它.

Then install it by running this below command in the same folder with the wheel package.

pip install MySQL_python-1.2.5-cp27-none-win32.whl

Python 3.7

使用mysqlclient‑1.3.13‑cp37‑cp37m‑win32.whl

这篇关于无法在Windows中安装mysql-python(新版本)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆