安装mysql报错error: command ‘gcc‘ failed with exit status 1

错误描述:error: command ‘gcc’ failed with exit status 1

[root@cloud-codec-qa-1d826557e-4 ~]# pip install MySQL-python==1.2.5
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Looking in indexes: http://jfrog.cloud.qiyi.domain/api/pypi/pypi/simple
Collecting MySQL-python==1.2.5
Downloading http://jfrog.cloud.qiyi.domain/api/pypi/pypi/packages/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip (108 kB)
|████████████████████████████████| 108 kB 13.1 MB/s
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-wSduxa/MySQL-python/setup.py'"'"'; file='"'"'/tmp/pip-install-wSduxa/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 /tmp/pip-record-er7qzW/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python2.7/MySQL-python
cwd: /tmp/pip-install-wSduxa/MySQL-python/
Complete output (27 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying mysql_exceptions.py -> build/lib.linux-x86_64-2.7creating build/lib.linux-x86_64-2.7/MySQLdbcopying MySQLdb/init.py -> build/lib.linux-x86_64-2.7/MySQLdbcopying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdbcopying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdbcopying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdbcopying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdbcopying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdbcreating build/lib.linux-x86_64-2.7/MySQLdb/constantscopying MySQLdb/constants/init.py -> build/lib.linux-x86_64-2.7/MySQLdb/constantscopying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constantscopying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constantscopying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constantscopying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constantscopying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constantscopying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constantsrunning build_extbuilding 'mysql' extensioncreating build/temp.linux-x86_64-2.7gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,2,5,'final',1) -D__version=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
unable to execute gcc: No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-wSduxa/MySQL-python/setup.py'"'"'; file='"'"'/tmp/pip-install-wSduxa/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 /tmp/pip-record-er7qzW/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python2.7/MySQL-python Check the logs for full command output.

解决方案

yum install -y libffi-devel python-devel openssl-devel
yum install -y gcc

你可能感兴趣的:(mysql,adb,android,linux)