为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

翻阅古今 2019-11-22 12:49:41
我想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.3Reading http://pypi.python.org/simple/greenlet/Reading https://github.com/python-greenlet/greenletReading http://bitbucket.org/ambroff/greenletBest match: greenlet 0.3.4Downloading http://pypi.python.org/packages/source/g/greenlet/greenlet-   0.3.4.zip#md5=530a69acebbb0d66eb5abd83523d8272Processing greenlet-0.3.4.zipWriting /tmp/easy_install-_aeHYm/greenlet-0.3.4/setup.cfgRunning greenlet-0.3.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_aeHYm/greenlet-0.3.4/egg-dist-tmp-t9_gbWIn file included from greenlet.c:5:0:greenlet.h:8:20: fatal error: Python.h: No such file or directorycompilation terminated.error: Setup script exited with error: command 'gcc' failed with exit status 1`为什么Python.h找不到?
查看完整描述

3 回答

?
冉冉说

TA贡献1877条经验 获得超1个赞

您的安装失败,因为您没有安装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


查看完整回答
反对 回复 2019-11-22
?
慕妹3242003

TA贡献1824条经验 获得超6个赞

对于Redhat版本(Centos 7),使用以下命令安装Python开发包


Python 2.7


sudo yum安装python-dev


Python 3.4


须藤百胜安装python34-devel


如果您的问题仍未解决,请尝试安装以下软件包-


须藤百胜安装python-devel


须藤yum install openssl-devel


须藤yum安装libffi-devel


查看完整回答
反对 回复 2019-11-22
?
杨__羊羊

TA贡献1943条经验 获得超7个赞

在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内部仍未成功


查看完整回答
反对 回复 2019-11-22
  • 3 回答
  • 0 关注
  • 898 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信