mysqlclient构建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('rn', '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/

I tried

 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

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

yum install python34-devel -y

pip3 install mysqlclient

这个话题很老了,但是对于那些可能遭受这个问题的人来说,这可能是你的解决方案:

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

$ pip install mysqlclient==1.3.12

最新更新