猿问

错误:安装eventlet时命令'gcc'失败,退出状态为1

我想eventlet在我的系统上安装,以使“ Herd”用于软件部署..但是终端显示了gcc错误:


  root@agrover-OptiPlex-780:~# easy_install -U eventlet

  Searching for eventlet

  Reading http://pypi.python.org/simple/eventlet/

  Reading http://wiki.secondlife.com/wiki/Eventlet

  Reading http://eventlet.net

   Best match: eventlet 0.9.16

    Processing eventlet-0.9.16-py2.7.egg

    eventlet 0.9.16 is already the active version in easy-install.pth


   Using /usr/local/lib/python2.7/dist-packages/eventlet-0.9.16-py2.7.egg

 Processing dependencies for eventlet

 Searching for greenlet>=0.3

Reading http://pypi.python.org/simple/greenlet/

Reading https://github.com/python-greenlet/greenlet

Reading http://bitbucket.org/ambroff/greenlet

Best match: greenlet 0.3.4

Downloading http://pypi.python.org/packages/source/g/greenlet/greenlet-   0.3.4.zip#md5=530a69acebbb0d66eb5abd83523d8272

Processing greenlet-0.3.4.zip

Writing /tmp/easy_install-_aeHYm/greenlet-0.3.4/setup.cfg

Running greenlet-0.3.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_aeHYm/greenlet-0.3.4/egg-dist-tmp-t9_gbW

In file included from greenlet.c:5:0:

greenlet.h:8:20: fatal error: Python.h: No such file or directory

compilation terminated.

error: Setup script exited with error: command 'gcc' failed with exit status 1`

为什么Python.h找不到?


翻阅古今
浏览 962回答 3
3回答

冉冉说

您的安装失败,因为您没有安装python开发标头。您可以通过在ubuntu / debian上通过apt来执行以下操作:sudo apt-get install python-dev 对于python3使用:sudo apt-get install python3-dev对于eventlet,您可能还需要安装libevent库,因此,如果在谈论该错误时可以使用以下命令安装libevent:sudo apt-get install libevent-dev

慕妹3242003

对于Redhat版本(Centos 7),使用以下命令安装Python开发包Python 2.7sudo yum安装python-devPython 3.4须藤百胜安装python34-devel如果您的问题仍未解决,请尝试安装以下软件包-须藤百胜安装python-devel须藤yum install openssl-devel须藤yum安装libffi-devel

杨__羊羊

在MacOS的我遇到了麻烦,安装fbprophet要求pystan,需要gcc进行编译。我将始终遇到相同的错误:命令“ gcc”失败,退出状态为1我想我自己解决了这个问题:我brew install gcc以前安装的是最新版本,gcc-8然后,我确保在gcc运行时将使用它gcc-8。它要么工作,因为我说alias gcc='gcc-8在我的.zshrc(相同.bashrc但zsh的),或者是因为我跑export PATH=/usr/local/bin:$PATH(见注释)另外:我的所有尝试都在虚拟环境中进行,并且仅通过fbprophet全局安装(使用pip)成功完成,但在venv内部仍未成功
随时随地看视频慕课网APP

相关分类

Python
我要回答