尝试通过Buildout在Ubuntu上安装PyCrypto,src/config.h:没有这样的文件或目录

2024-10-01 05:05:45 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图通过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

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

值得注意的是,我在雪豹本地也遇到了同样的问题,我可以直接下载代码并手动运行python manage.py build和{}来解决这个问题。我想避免这种情况,因为我要部署到一打服务器上。在


Tags: installpathpyimportcacheforosegg
3条回答

作为一个更新,PyCrypto已经解决了这个问题,您可以从标记为“Fix resolved”的票证中看到:https://bugs.launchpad.net/pycrypto/+bug/881130。仅供参考,以防以后有人发现。这个“应该”现在不是问题了。在

即使使用最新的pycrypto,我还是会遇到这个问题,所以我只需运行./configure并创建src/config.h,现在只需运行pip或easy\u install or,设置.py... 在

看来这是一个悬而未决的问题。解决方法是使用pip,或者坚持使用pycrypto2.3。https://bugs.launchpad.net/pycrypto/+bug/881130

编辑:这个错误在pycrypto2.4.1中被修复了。在

相关问题 更多 >