2012-03-27 45 views
6

我想安裝M2Crypto,以便我可以在我的web應用程序中生成pkey。我的託管要求決定我必須使用pip來安裝任何依賴項。在系統級別安裝m2crypto不是我的選擇。我在開發中使用Mint 12,並將部署到heroku。如何讓Python m2Crypto與virtualenv一起工作?

錯誤:命令「痛飲」,退出狀態1貌似問題失敗了,但谷歌並沒有幫助。 想法?

自卸

Downloading/unpacking m2crypto 
    Downloading M2Crypto-0.21.1.tar.gz (413Kb): 413Kb downloaded 
    Running setup.py egg_info for package m2crypto 

Installing collected packages: m2crypto 
    Running setup.py install for m2crypto 
    building 'M2Crypto.__m2crypto' extension 
    swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c 
    swig -python -I/usr/include/python2.7 -I/usr/include -includeall -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i 
    unable to execute swig: No such file or directory 
    error: command 'swig' failed with exit status 1 
    Complete output from command /home/bob/.virtualenvs/my_app/bin/python -c "import setuptools;__file__='/home/bob/.virtualenvs/my_app/build/m2crypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-O1V45n-record/install-record.txt --install-headers /home/bob/.virtualenvs/my_app/include/site/python2.7: 
    running install 
running build 
(....clip...) 
swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c 
swig -python -I/usr/include/python2.7 -I/usr/include -includeall -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i 
unable to execute swig: No such file or directory 
error: command 'swig' failed with exit status 1 

---------------------------------------- 
Command /home/bob/.virtualenvs/my_app/bin/python -c "import setuptools;__file__='/home/bob/.virtualenvs/my_app/build/m2crypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-O1V45n-record/install-record.txt --install-headers /home/bob/.virtualenvs/my_app/include/site/python2.7 failed with error code 1 in /home/bob/.virtualenvs/my_app/build/m2crypto 

回答

12

您的問題無關的virtualenv。你只是沒有安裝swig。

安裝使用痛飲發行版的包管理器,並嘗試在重新安裝的virtualenv M2Crypto。

0

它看起來像錯誤消息說痛飲無法找到。是在你的虛擬世界中,並在你的道路上?

同時,爲了M2Crypto工作,你將需要訪問的OpenSSL安裝。如果您無法連接系統的安裝,則需要將其安裝在本地虛擬環境中,並指出您的鏈接/庫/包含語句以使用它。

+0

你是什麼「的意思是在你的虛擬世界和你的道路上揮灑?「我想答案是否定的。 – bdd 2012-03-27 21:56:52

-1

對不起,它不是更清楚。我認爲問題在於你不在你的道路上。該錯誤消息說:

無法執行痛飲:沒有這樣的文件或目錄

如果從命令提示符下運行「痛飲」會發生什麼?

2

我對pip install M2Crypto解決方案,我VIRTUALENV我的Mac上使用OSX如下:

答:退出的virtualenv

B:下載使用下面的鏈接並按照INSTALL文本痛飲文件說明安裝它。

http://sourceforge.net/projects/swig/?source=dlp

C:安裝PCRE開發者版本,以及因爲痛飲需要它來運行。按照下面的鏈接和INSTALL文本文檔的說明安裝它。

http://sourceforge.net/projects/pcre/?source=dlp

d:重新回到我的virtualenv,我試圖M2Crypto首先安裝到,激活virtualenv,並運行:

pip install M2Crypto