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

发布于 2024-12-12 07:39:34 字数 1344 浏览 0 评论 0原文

我正在尝试通过 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 buildpython manage.py install 来修复它手工。我想在这里避免这种情况,因为我正在部署到十几台服务器。

I'm trying to install PyCrypto on an Ubuntu instance via Buildout (via easy_install) and I'm getting the following error:

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

Any idea on what's causing this?

Notably, I had the same issue locally on Snow Leopard and I was able to fix it by downloading the code directly and running python manage.py build and python manage.py install by hand. I want to avoid that here because I'm deploying to a dozen servers.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

2024-12-19 07:39:34

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

Even with the newest pycrypto I keep having this problem, so I just run ./configure and the src/config.h is created, so now just run pip or, easy_install or, setup.py...

葵雨 2024-12-19 07:39:34

您还可以下载 pycrypto-2.4.tar.gz 解压并运行(以 root 身份):

./configure
python setup.py install

之后 pycrypto 将安装到 /usr/lib/python2.7/site-packages/Crypto 中。我在“easy_install pysnmp”上测试了它。

You can also download pycrypto-2.4.tar.gz unpack it and run (as root):

./configure
python setup.py install

After that pycrypto will be installed into /usr/lib/python2.7/site-packages/Crypto. I tested it on 'easy_install pysnmp'.

烟凡古楼 2024-12-19 07:39:34

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

编辑:此错误已在 PyCrypto 2.4.1 中修复。

It appears this is an open issue. The workaround is to use pip instead or stick to PyCrypto 2.3. https://bugs.launchpad.net/pycrypto/+bug/881130

EDIT: This bug was fixed in PyCrypto 2.4.1.

陪你搞怪i 2024-12-19 07:39:34

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

Just as an update, PyCrypto has since resolved this issue as you can see from the ticket being marked "Fix Resolved": https://bugs.launchpad.net/pycrypto/+bug/881130. Just an FYI, in case someone comes across this later. This "should" be a non-issue now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文