首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gcc pip升级pyzmq失败

gcc pip升级pyzmq失败
EN

Stack Overflow用户
提问于 2014-08-15 06:46:04
回答 1查看 4.8K关注 0票数 2

我在CentOS 5.6下工作。我两样都有

gcc(gcc (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时,我收到以下错误消息:

代码语言:javascript
复制
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

有人能帮我吗?

EN

回答 1

Stack Overflow用户

发布于 2014-11-08 20:24:04

我在尝试这个pip命令时遇到了完全相同的错误:

代码语言:javascript
复制
pip install "ipython[notebook]

完整错误如下:

代码语言:javascript
复制
/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头文件。

四处搜索,I found out告诉我需要安装python-dev包。我确信yum (CentOS)中会有一个相应的包,但在我的Ubuntu机器上,我输入了:

代码语言:javascript
复制
apt-get install python-dev

在那之后,我将Python.h放在了include目录中,我就能够完成构建了。

票数 9
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25318766

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档