我在CentOS 5.6下工作.我有两个
gcc(gcc(GCC)4.1.2 20080704(Red Hat 4.1.2-52))
和gcc44(gcc44(GCC)4.4.6 20110731(Red Hat 4.4.6-3))
在/ usr/bin /.
当我做pip install -U pyzmq时,我收到以下错误消息:
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-dev软件包.我确定在yum(CentOS)中会有相应的包,但是在我的Ubuntu机器上,我输入了:
apt-get install python-dev
之后,我在包含目录的Python.h中,我能够完成构建.