我在安装python包mysql python时得到一个错误信息:
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting MySQL-python
Downloading http://mirrors.aliyun.com/pypi/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip (108kB)
100% |████████████████████████████████| 112kB 4.0MB/s
matplotlib 1.3.1 requires nose, which is not installed.
matplotlib 1.3.1 requires tornado, which is not installed.
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/n1/h16b3pt554s2sy049z9x3d200000gn/T/pip-install-pA4LHD/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 /private/var/folders/n1/h16b3pt554s2sy049z9x3d200000gn/T/pip-record-msZOoz/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.14-intel-2.7
copying _mysql_exceptions.py -> build/lib.macosx-10.14-intel-2.7
creating build/lib.macosx-10.14-intel-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
creating build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.14-intel-2.7
cc -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -arch i386 -arch x86_64 -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/Cellar/mysql/8.0.12/include/mysql -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.14-intel-2.7/_mysql.o
_mysql.c:44:10: fatal error: 'my_config.h' file not found
#include "my_config.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'cc' failed with exit status 1
我的系统版本是MacOS10.14Mojave。
1条答案
按热度按时间ctehm74n1#
mysql python是本机客户机库的python Package 器,您必须首先安装它们。它们可以从mysql的站点下载。