问题:
........................
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
running build_ext
building \'_mysql\' extension
creating build/temp.linux-x86_64-3.6
gcc -pthread -B /data/important-software/anaconda3/envs/jumpserver/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,3,12,\'final\',0) -D__version__=1.3.12 -I/data/important-software/mysql/mysql-base/include -I/data/important-software/anaconda3/envs/jumpserver/include/python3.6m -c _mysql.c -o build/temp.linux-x86_64-3.6/_mysql.o
_mysql.c: In function ‘_mysql_ConnectionObject_ping’:
_mysql.c:1894:3: error: unknown type name ‘my_bool’
my_bool recon = reconnect;
^
error: command \'gcc\' failed with exit status 1
----------------------------------------
***Failed building wheel for mysqlclient***
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
Complete output from command /data/important-software/anaconda3/envs/jumpserver/bin/python -u -c "import setuptools, tokenize;__file__=\'/tmp/pip-install-3c7qety7/mysqlclient/setup.py\';f=getattr(tokenize, \'open\', open)(__file__);code=f.read().replace(\'\r\n\', \'\n\');f.close();exec(compile(code, __file__, \'exec\'))" install --record /tmp/pip-record-e4jnslv6/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
copying _mysql_exceptions.py -> build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.6/MySQLdb
........................
网上搜了好久都没解决!!!
***最终还是搞定了 哈哈***
![解决方法地址]{https://stackoverflow.com/questions/33315210/error-command-x86-64-linux-gnu-gcc-when-installing-mysqlclient}
Tried all of the above suggestions and a few found elsewhere and nothing worked. In the end the solution was simple enough (courtesy of ignacionf on GitHub):
***`pip install git+https://github.com/PyMySQL/mysqlclient-python.git`***