我试图通过Buildout(通过easy\_install)在Ubuntu实例上安装PyCrypto,但出现以下错误:

Getting distribution for 'pycrypto>=1.9'.
Running easy_install:
/usr/bin/python "-S" "-c" "import sys,os;p = sys.path[:];import site;sys.path[:] = p;    [sys.modules.pop(k) for k, v in sys.modules.items() if hasattr(v, '__path__') and len(v.__path__)==1 and not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))];from setuptools.command.easy_install import main;main()" "-mUNxd" "/opt/rocktech/buildout/cache/eggs/tmppKIfK7" "-Z" "/opt/rocktech/buildout/cache/download/dist/pycrypto-2.4.tar.gz"
path=/opt/rocktech/buildout/cache/eggs/setuptools-0.6c12dev_r88846-py2.6.egg

Processing pycrypto-2.4.tar.gz
Running pycrypto-2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-dD_8Pu/pycrypto-    2.4/egg-dist-tmp-_d3xDl
error: Setup script exited with error: src/config.h: No such file or directory
An error occurred when trying to install pycrypto 2.4. Look above this message for any     errors that were output by easy_install.
While:
  Installing django.
  Getting distribution for 'pycrypto>=1.9'.
Error: Couldn't install: pycrypto 2.4

知道是什么原因造成的吗?

值得注意的是,我在Snow Leopard上在本地遇到了相同的问题,我可以通过直接下载代码并手动运行python manage.py build和python manage.py install来解决此问题.我想在这里避免这种情况,因为我要部署到十几个服务器.

解决方法:


即使使用最新的pycrypto,我仍然遇到这个问题,所以我只运行./configure并创建src / config.h,所以现在只运行pip或easy\_install或setup.py …

标签: ubuntu, python, pycrypto

相关文章推荐

添加新评论,含*的栏目为必填