我想在我的系统上安装eventlet,以便"从众"进行软件部署..但终端显示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

推荐答案

您的安装失败,因为您没有安装python开发头.你可以通过ubuntu/debian上的apt来实现这一点:

sudo apt-get install python-dev 

对于python3,请使用:

sudo apt-get install python3-dev

对于eventlet,您可能还需要安装libevent个库,因此如果您遇到错误,可以使用以下命令安装libeevent:

sudo apt-get install libevent-dev

Python相关问答推荐

比较两个二元组列表,NP.isin

如何在具有重复数据的pandas中对groupby进行总和,同时保留其他列

为什么我的Python代码在if-else声明中的行之前执行if-else声明中的行?

如何让剧作家等待Python中出现特定cookie(然后返回它)?

如何使用html从excel中提取条件格式规则列表?

为什么sys.exit()不能与subproccess.run()或subprocess.call()一起使用

Python—从np.array中 Select 复杂的列子集

NumPy中条件嵌套for循环的向量化

删除marplotlib条形图上的底边

在www.example.com中使用`package_data`包含不包含__init__. py的非Python文件

在Python中调用变量(特别是Tkinter)

Maya Python脚本将纹理应用于所有对象,而不是选定对象

Matplotlib中的字体权重

LocaleError:模块keras._' tf_keras. keras没有属性__internal_'''

Python—为什么我的代码返回一个TypeError

如何反转一个框架中列的值?

如何在Airflow执行日期中保留日期并将时间转换为00:00

我可以不带视频系统的pygame,只用于游戏手柄输入吗?''

如何使用加速广播主进程张量?

Python:从目录内的文件导入目录