【问题标题】:gcc failed when pip upgrading pyzmqpip升级pyzmq时gcc失败
【发布时间】:2014-08-14 22:46:03
【问题描述】:

我在 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

谁能帮我解决这个问题?

【问题讨论】:

  • 在带有 i686-linux-gnu-gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2 的 Ubuntu 14.04 上对我来说同样的问题

标签: python-2.7 redhat


【解决方案1】:

我在尝试这个 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 标头文件。

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

apt-get install python-dev

在那之后,我在那个包含目录中有 Python.h,并且我能够完成构建。

【讨论】:

    猜你喜欢
    • 2018-12-17
    • 2021-11-15
    • 2021-05-04
    • 1970-01-01
    • 2019-05-24
    • 2022-11-11
    • 1970-01-01
    • 2011-10-27
    • 1970-01-01
    相关资源
    最近更新 更多