CentOS7上 pip install MySQL-python 安装失败(error: command 'gcc' failed with exit status 1)的解决办法
2017-07-16 17:57
1301 查看
(pk_env) [dechao@s97-74-237-68 ~]$ pip install MySQL-python
Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip
Building wheels for collected packages: MySQL-python
Running setup.py bdist_wheel for MySQL-python ... error
Complete output from command /home/dechao/pk_env/bin/python2.7 -u -c "import setuptools, tokenize;_
_file__='/tmp/pip-build-VCoMlt/MySQL-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);cod
e=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp
/tmp1M4ik7pip-wheel- --python-tag cp27:
running bdist_wheel
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.7
creating build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
creating build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-p
rotector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fP
IC -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
_mysql.c:29:20: 致命错误:Python.h:没有那个文件或目录
#include "Python.h"
^
编译中断。
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for MySQL-python
Running setup.py clean for MySQL-python
Failed to build MySQL-python
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python ... error
Complete output from command /home/dechao/pk_env/bin/python2.7 -u -c "import setuptools, tokenize
;__file__='/tmp/pip-build-VCoMlt/MySQL-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);c
ode=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record
/tmp/pip-OAwTQG-record/install-record.txt --single-version-externally-managed --compile --install-hea
ders /home/dechao/pk_env/include/site/python2.7/MySQL-python:
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.7
creating build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
creating build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-x86_64-2.7
gcc -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-stron
g --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fP
IC -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
_mysql.c:29:20: 致命错误:Python.h:没有那个文件或目录
#include "Python.h"
^
编译中断。
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/home/dechao/pk_env/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-buil
d-VCoMlt/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-OAwTQG-record/i
nstall-record.txt --single-version-externally-managed --compile --install-headers /home/dechao/pk_env
/include/site/python2.7/MySQL-python" failed with error code 1 in /tmp/pip-build-VCoMlt/MySQL-python/
---------------------------- 安装 python-devel
(pk_env) [dechao@s97-74-237-68 ~]$ sudo yum install python-devel
----------------------------
之后 pip instal MySQL-python 成功
Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip
Building wheels for collected packages: MySQL-python
Running setup.py bdist_wheel for MySQL-python ... error
Complete output from command /home/dechao/pk_env/bin/python2.7 -u -c "import setuptools, tokenize;_
_file__='/tmp/pip-build-VCoMlt/MySQL-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);cod
e=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp
/tmp1M4ik7pip-wheel- --python-tag cp27:
running bdist_wheel
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.7
creating build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
creating build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-p
rotector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fP
IC -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
_mysql.c:29:20: 致命错误:Python.h:没有那个文件或目录
#include "Python.h"
^
编译中断。
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for MySQL-python
Running setup.py clean for MySQL-python
Failed to build MySQL-python
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python ... error
Complete output from command /home/dechao/pk_env/bin/python2.7 -u -c "import setuptools, tokenize
;__file__='/tmp/pip-build-VCoMlt/MySQL-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);c
ode=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record
/tmp/pip-OAwTQG-record/install-record.txt --single-version-externally-managed --compile --install-hea
ders /home/dechao/pk_env/include/site/python2.7/MySQL-python:
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.7
creating build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
creating build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-x86_64-2.7
gcc -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-stron
g --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fP
IC -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
_mysql.c:29:20: 致命错误:Python.h:没有那个文件或目录
#include "Python.h"
^
编译中断。
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/home/dechao/pk_env/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-buil
d-VCoMlt/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-OAwTQG-record/i
nstall-record.txt --single-version-externally-managed --compile --install-headers /home/dechao/pk_env
/include/site/python2.7/MySQL-python" failed with error code 1 in /tmp/pip-build-VCoMlt/MySQL-python/
---------------------------- 安装 python-devel
(pk_env) [dechao@s97-74-237-68 ~]$ sudo yum install python-devel
----------------------------
之后 pip instal MySQL-python 成功
相关文章推荐
- mac下安装mysql-python包报unable to execute llvm-gcc-4.2: No such file or directory error: command 'llvm-gcc-4.2' failed with exit status 1解决方法
- 关于Python安装模块出现error: command 'gcc' failed with exit status 1错误的解决方法
- 安装MySQL-python时发生错误:error: command 'gcc' failed with exit status 1
- 安装MySQL-python时发生错误:error: command 'gcc' failed with exit status 1
- 关于pip install安装python依赖包时报错:command 'gcc' failed with exit status 1的解决方案
- MAC安装python模块碰到“error: command 'cc' failed with exit status 1”解决办法
- [CentOS]安装MySQL-python,error: Setup script exited with error: command 'gcc' failed with exit status
- 解决Python扩展程序编译安装的error: command 'mt.exe' failed with exit status 31
- 安装MySQL-python-1.2.3c1出现“error: command 'gcc' failed with exit status 1”错误
- error: command 'gcc' failed with exit status 1 的解决办法
- error: command 'gcc' failed with exit status 1 的解决办法
- error: command 'gcc' failed with exit status 4 问题的解决办法
- pip install --upgrade pip,error: command 'gcc' failed with exit status 1
- MySQL-python “error: command 'gcc' failed with exit status 1”错误
- Centos4.3安装MySQL-python-1.2.3,出现error: command 'gcc' failed with exit status 1
- centos7.2安装paramiko报error: command 'gcc' failed with exit status 1的解决办法
- CentOS7安装Murano-agent时的error:command 'gcc' failed with exit status 1
- 关于python 安装lxml-4.1.1 报 error: command 'gcc' failed with exit status 1
- 安装MySQL-python时发生错误:error: command 'gcc' failed with exit status 1
- python 安装superset:error: Setup script exited with error: command 'gcc' failed with exit status 1