mysqlclient的构建轮失败

时间:2016-11-04 00:57:52

标签: python pip python-wheel

我将wheel下载到最新版本

但我不完全确定如何制作这个半隐秘的错误消息

  Failed building wheel for mysql-python

  Command "/Users/username/Desktop/Project/venv/bin/python -u -c "import setuptools, 
  tokenize;__file__='/private/var/folders/bg/_nsyc_vxasdfx___h11f3jw00000gn/T/pip-build-rBf9R1/mysql-python/setup.py';
 f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');
  f.close();exec(compile(code, __file__, 'exec'))" 
install --record /var/folders/bg/_nsyc_vx4g___xbsh11f3jw00000gn/T/pip-Tjwbij-record/install-record.txt --single-version-externally-managed 
--compile --install-headers /Users/username/Desktop/project/venv/include/site/python2.7/mysql-python" failed with error code 1 in 
/private/var/folders/bg/_nsyc_vxasdf__xbsh11f3jw00000gn/T/pip-build-rBf9R1/mysql-python/

我试过

 pip install --upgrade wheel

我得到了

Requirement already up-to-date: wheel

MySQL版

mysql  Ver 14.14 Distrib 5.7.10, for osx10.11 (x86_64) using  EditLine wrapper

2 个答案:

答案 0 :(得分:1)

至于我,这是因为我的系统缺乏python3开发lib。它警告说没有" Python.h"安装时。以下命令为我修复它。

yum install python34-devel -y

pip3 install mysqlclient

答案 1 :(得分:0)

这个话题已经很老了,但是对于那些可能会遇到这个问题的人来说,这可以是您的解决方案:

首先,必须打开使用Python的文件,例如3.5、3.6,Anaconda等。然后在该文件中打开cmd并运行以下命令:

$ pip install mysqlclient==1.3.12