为什么我不能安装greenlet(只是一个基本的python包)?

我把它解开了: http : //pypi.python.org/pypi/greenlet#downloads (我在我的虚拟环境中,我也是这样的,那就是为什么我没有sudo)

$ py setup.py install /usr/lib/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: 'repository' warnings.warn(msg) running install running bdist_egg running egg_info writing greenlet.egg-info/PKG-INFO writing top-level names to greenlet.egg-info/top_level.txt writing dependency_links to greenlet.egg-info/dependency_links.txt reading manifest file 'greenlet.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'greenlet.egg-info/SOURCES.txt' installing library code to build/bdist.linux-i686/egg running install_lib running build_ext building 'greenlet' extension creating build creating build/temp.linux-i686-2.6 gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c greenlet.c -o build/temp.linux-i686-2.6/greenlet.o In file included from greenlet.c:5: greenlet.h:11: fatal error: Python.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status 1 

在Ubuntu上,你需要安装python-dev软件包。 这提供了Python.h头文件:

 % dpkg -S /usr/include/python2.6/Python.h python2.6-dev: /usr/include/python2.6/Python.h 

你没有安装python-dev所以没有Python.h头文件。