[英]Ubuntu - trying to install Python Couchbase lib - “libcouchbase/couchbase.h: No such file or directory”
[英]Trying to install PyCrypto on Ubuntu via Buildout, src/config.h: No such file or directory
我正在嘗試通過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 ...
看來這是一個懸而未決的問題。 解決方法是使用pip代替或堅持使用PyCrypto 2.3。 https://bugs.launchpad.net/pycrypto/+bug/881130
編輯:此錯誤已在PyCrypto 2.4.1中修復。
就像更新一樣,PyCrypto已經解決了這個問題,因為你可以從標有“Fix Resolved”的票證中看到: https : //bugs.launchpad.net/pycrypto/+bug/881130 。 只是一個FYI,以防有人偶然遇到這個問題。 這“應該”現在不成問題。
你也可以下載pycrypto-2.4.tar.gz解包並運行(以root身份):
./configure
python setup.py install
之后,pycrypto將被安裝到/usr/lib/python2.7/site-packages/Crypto中。 我在'easy_install pysnmp'上測試了它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.