我正在尝试安装 M2Crypto,以便我可以在我的网络应用程序中生成 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('\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
最佳答案
您的问题与 virtualenv 无关。你只是没有安装 swig。
使用发行版的包管理器安装 swig 并尝试在 virtualenv 中重新安装 M2Crypto。
关于python - 如何让 Python m2Crypto 与 virtualenv 一起工作?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/9892606/