我正在尝试安装M2Crypto,以便在我的web应用程序中生成pkey。我的托管要求要求我必须使用pip来安装任何依赖项。在系统级别安装m2crypto对我来说不是一个选择。我在开发中使用Mint 12,并将部署到heroku。
错误:命令"swig"失败,退出状态为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('rn', '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('rn', '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
您的问题与virtualenv无关。你只是没有安装swig。
使用发行版的软件包管理器安装swig,并尝试在虚拟机中重新安装M2Crypto。
我在带有OSX的Mac上的VirtualEnv中的pip install M2Crypto
解决方案如下:
A:退出虚拟
B:使用以下链接下载Swig,并按照INSTALL文本文档中的说明进行安装。
http://sourceforge.net/projects/swig/?source=dlp
C:也安装PCRE开发人员版本,因为Swig需要它来运行。按照下面的链接和INSTALL文本文档的说明进行安装。
http://sourceforge.net/projects/pcre/?source=dlp
D:回到我最初试图安装M2Crypto的virtualenv
,激活virtualenv
,然后运行:
pip install M2Crypto
看起来错误消息显示找不到swig。swig在你的美德中,在你的道路上吗?
此外,要使M2Crypto发挥作用,您需要访问OpenSSL安装。如果你不能链接到系统的安装,你需要在本地虚拟机中安装它,并指向你的链接/库/include语句来使用它。
很抱歉没有更清楚。我认为问题是swig不在你的道路上。错误信息显示:
无法执行swig:没有这样的文件或目录
如果在命令提示符下运行"swig",会发生什么情况?