简体   繁体   English

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

[英]Trying to install PyCrypto on Ubuntu via Buildout, src/config.h: No such file or directory

I'm trying to install PyCrypto on an Ubuntu instance via Buildout (via easy_install) and I'm getting the following error: 我正在尝试通过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

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. 值得注意的是,我在Snow Leopard本地遇到了同样的问题,我可以通过直接下载代码并手动运行python manage.py buildpython manage.py install来修复它。 I want to avoid that here because I'm deploying to a dozen servers. 我想避免这种情况,因为我正在部署到十几台服务器。

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

It appears this is an open issue. 看来这是一个悬而未决的问题。 The workaround is to use pip instead or stick to PyCrypto 2.3. 解决方法是使用pip代替或坚持使用PyCrypto 2.3。 https://bugs.launchpad.net/pycrypto/+bug/881130 https://bugs.launchpad.net/pycrypto/+bug/881130

EDIT: This bug was fixed in PyCrypto 2.4.1. 编辑:此错误已在PyCrypto 2.4.1中修复。

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 . 就像更新一样,PyCrypto已经解决了这个问题,因为你可以从标有“Fix Resolved”的票证中看到: https//bugs.launchpad.net/pycrypto/+bug/881130 Just an FYI, in case someone comes across this later. 只是一个FYI,以防有人偶然遇到这个问题。 This "should" be a non-issue now. 这“应该”现在不成问题。

You can also download pycrypto-2.4.tar.gz unpack it and run (as root): 你也可以下载pycrypto-2.4.tar.gz解包并运行(以root身份):

./configure
python setup.py install

After that pycrypto will be installed into /usr/lib/python2.7/site-packages/Crypto. 之后,pycrypto将被安装到/usr/lib/python2.7/site-packages/Crypto中。 I tested it on 'easy_install pysnmp'. 我在'easy_install pysnmp'上测试了它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Ubuntu - 尝试安装 Python Couchbase lib - “libcouchbase/couchbase.h:没有这样的文件或目录” - Ubuntu - trying to install Python Couchbase lib - “libcouchbase/couchbase.h: No such file or directory” Pycrypto 安装致命错误:找不到 gmp.h 文件 - Pycrypto install fatal error: gmp.h file not found 如何通过构建安装Readline - How to install readline via buildout 尝试安装 PyCrypto 时出错 - Error when trying to install PyCrypto 在Ubuntu 10.04上通过构建设置GDAL - Setting up GDAL via buildout on Ubuntu 10.04 pyarrow==0.17.1 安装以致命错误结束:找不到“arrow/python/config.h”文件(Apple M1 芯片) - pyarrow==0.17.1 installation ends with fatal error: 'arrow/python/config.h' file not found (Apple M1 chip) 无法在Ubuntu 12.04上的virtualenv中安装pycrypto - Cannot install pycrypto inside virtualenv on ubuntu 12.04 MySQLdb 安装错误 - _mysql.c:44:23: error: my_config.h: No such file or directory - MySQLdb install error - _mysql.c:44:23: error: my_config.h: No such file or directory 尝试在 Mac OSX 小牛上安装 pycrypto - Trying to install pycrypto on Mac OSX mavericks 我正在尝试为django导入mysqldb。 'my_config.h'没有这样的文件或目录是我得到的错误 - I am trying to import mysqldb for django. 'my_config.h ' no such file or directory is the error that i am getting
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM