Python 2.7 pip升级pyzmq时gcc失败
我在CentOS 5.6下工作。我两者都有 通用条款(通用条款(gcc)4.1.2 20080704(红帽4.1.2-52)) 和gcc44(gcc44(GCC)4.4.6 20110731(红帽4.4.6-3)) 在/usr/bin/上 在执行pip安装-U pyzmq时,我收到以下错误消息:Python 2.7 pip升级pyzmq时gcc失败,python-2.7,redhat,Python 2.7,Redhat,我在CentOS 5.6下工作。我两者都有 通用条款(通用条款(gcc)4.1.2 20080704(红帽4.1.2-52)) 和gcc44(gcc44(GCC)4.4.6 20110731(红帽4.4.6-3)) 在/usr/bin/上 在执行pip安装-U pyzmq时,我收到以下错误消息: Downloading/unpacking pyzmq from https://pypi.python.org/packages/source/p/pyzmq/pyzmq-14.3.1.tar.gz#
Downloading/unpacking pyzmq from https://pypi.python.org/packages/source/p/pyzmq/pyzmq-14.3.1.tar.gz#md5=7196b4a6fbf98022f17ffa924be3d68d
Running setup.py egg_info for package pyzmq
no previously-included directories found matching 'docs/build'
no previously-included directories found matching 'docs/gh-pages'
warning: no previously-included files found matching 'bundled/zeromq/src/Makefile*'
warning: no previously-included files found matching 'setup.cfg'
warning: no previously-included files found matching 'zmq/libzmq*'
warning: no previously-included files matching '__pycache__/*' found anywhere in distribution
warning: no previously-included files matching '.deps/*' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '.mailmap' found anywhere in distribution
warning: no previously-included files matching 'Makefile.am' found anywhere in distribution
warning: no previously-included files matching 'Makefile.in' found anywhere in distribution
Installing collected packages: pyzmq
Found existing installation: pyzmq 2.1.11
Uninstalling pyzmq:
Successfully uninstalled pyzmq
Running setup.py install for pyzmq
Using bundled libzmq
already have bundled/zeromq
already have platform.hpp
checking for timer_create
************************************************
************************************************
cc -c /tmp/timer_createbuFGwC.c -o build/temp.linux-x86_64-2.7/tmp/timer_createbuFGwC.o
unable to execute cc: No such file or directory
no timer_create, linking librt
Using bundled libsodium
already have bundled/libsodium
already have version.h
already have crypto_stream_salsa20.h
already have crypto_scalarmult_curve25519.h
************************************************
************************************************
building 'zmq.libsodium' extension
/usr/bin/gcc44 -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DNATIVE_LITTLE_ENDIAN=1 -Ibundled/libsodium/src/libsodium/include -Ibundled/libsodium/src/libsodium/include/sodium -I/opt/python27/include/python2.7 -c buildutils/initlibsodium.c -o build/temp.linux-x86_64-2.7/buildutils/initlibsodium.o
buildutils/initlibsodium.c:10:20: error: Python.h: No such file or directory
buildutils/initlibsodium.c:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Methods’
buildutils/initlibsodium.c:40: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘initlibzmq’
error: command '/usr/bin/gcc44' failed with exit status 1
Complete output from command /opt/python27/bin/python2.7 -c "import setuptools;__file__='/home/fzeng/build/pyzmq/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-90NjCM-record/install-record.txt:
running install
running build
running build_py
running build_ext
running configure
Using bundled libzmq
already have bundled/zeromq
already have platform.hpp
checking for timer_create
************************************************
************************************************
cc -c /tmp/timer_createbuFGwC.c -o build/temp.linux-x86_64-2.7/tmp/timer_createbuFGwC.o
unable to execute cc: No such file or directory
no timer_create, linking librt
Using bundled libsodium
already have bundled/libsodium
already have version.h
already have crypto_stream_salsa20.h
already have crypto_scalarmult_curve25519.h
************************************************
************************************************
building 'zmq.libsodium' extension
/usr/bin/gcc44 -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DNATIVE_LITTLE_ENDIAN=1 -Ibundled/libsodium/src/libsodium/include -Ibundled/libsodium/src/libsodium/include/sodium -I/opt/python27/include/python2.7 -c buildutils/initlibsodium.c -o build/temp.linux-x86_64-2.7/buildutils/initlibsodium.o
buildutils/initlibsodium.c:10:20: error: Python.h: No such file or directory
buildutils/initlibsodium.c:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Methods’
buildutils/initlibsodium.c:40: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘initlibzmq’
error: command '/usr/bin/gcc44' failed with exit status 1
----------------------------------------
Rolling back uninstall of pyzmq
Command /opt/python27/bin/python2.7 -c "import setuptools;__file__='/home/fzeng/build/pyzmq/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-90NjCM-record/install-record.txt failed with error code 1 in /home/fzeng/build/pyzmq
Storing complete log in /root/.pip/pip.log
有人能帮我吗?我在尝试此pip命令时遇到了完全相同的错误:
pip install "ipython[notebook]
完整错误如下所示:
/usr/bin/gcc44 -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3
-Wall -Wstrict-prototypes -fPIC -DNATIVE_LITTLE_ENDIAN=1
-Ibundled/libsodium/src/libsodium/include
-Ibundled/libsodium/src/libsodium/include/sodium
-I/opt/python27/include/python2.7 -c buildutils/initlibsodium.c
-o build/temp.linux-x86_64-2.7/buildutils/initlibsodium.o
buildutils/initlibsodium.c:10:20: error: Python.h: No such file or directory
该错误表示编译器(gcc44)在/opt/python27/include/python2.7中找不到头文件Python.h。(在我的构建中,它是在/usr/include/python2.7中查找的。)因为我在Ubuntu上,所以我一直在试图找到需要安装哪个包才能引入Python头文件
四处搜索,我需要安装python开发包。我确信在yum(CentOS)中会有相应的包,但在我的Ubuntu机器上,我键入了:
apt-get install python-dev
在那之后,我将Python.h放在include目录中,并且我能够完成构建。我在使用i686 linux gnu gcc(Ubuntu 4.8.2-19ubuntu1)4.8.2的Ubuntu 14.04上遇到了同样的问题