【发布时间】:2016-05-24 11:41:00
【问题描述】:
我尝试在 El Capitan 上安装 Scrapy,但尚未成功。当我使用pip install Scrapy 时会发生这种情况:
#include <openssl/opensslv.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /<scrapy_project>/venv/bin/python -c "import setuptools, tokenize;__file__='/<scrapy_project>/venv/build/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/p6/jvf54l7d5c7dntzm6d3rfc3w0000gn/T/pip-D2QIZq-record/install-record.txt --single-version-externally-managed --compile --install-headers /<scrapy_project>/venv/include/site/python2.7 failed with error code 1 in /<scrapy_project>/venv/build/cryptography
我的 Xcode 和 Xcode 命令工具是最新的。 根据http://doc.scrapy.org/en/latest/intro/install.html#intro-install
,我尝试通过自制软件安装和不安装 Scrapy编辑:我做了以下:
-
brew install openssl && brew link openssl --force根据 Craicerjack 的建议 pip install cryptographypip install scrapy
一切正常,没有任何错误。但是scrapy --version 抛出这个错误:
ImportError: dlopen(/<scrapy_project>/venv/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so, 2): Symbol not found: _BIO_new_CMS
Referenced from: /<scrapy_project>/venv/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so
Expected in: flat namespace
in /<scrapy_project>/venv/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so
【问题讨论】:
-
看起来像是构建密码学包的问题。也许
pip install cryptography首先? the second comment on this question 也可能会有所帮助 -
您缺少用于 openssl 的开发包
-
@Craicerjack 感谢您的评论!请查看我的问题的编辑。
-
这个问题,stackoverflow.com/questions/33462779/…,似乎有解决方案。
-
耶!你拯救了我的一天。谢谢@Craicerjack!如果你愿意,你可以发布一个我会接受的解决方案。