python - Scrapy 安装失败,出现错误 'cannot open include: ' openssl/aes.h '

标签 python installation scrapy easy-install

我正在尝试使用 easy_install -U Scrapy 安装 Scrapy,但在尝试安装时出现奇怪的错误“无法打开包含文件”。有谁知道发生了什么事?这是我的完整回溯:

C:\Users\Mubashar Kamran>easy_install -U Scrapy
Searching for Scrapy
Reading https://pypi.python.org/simple/Scrapy/
Best match: scrapy 0.24.4
Processing scrapy-0.24.4-py2.7.egg
scrapy 0.24.4 is already the active version in easy-install.pth
Installing scrapy-script.py script to C:\Python27\Scripts
Installing scrapy.exe script to C:\Python27\Scripts
Installing scrapy.exe.manifest script to C:\Python27\Scripts

Using c:\python27\lib\site-packages\scrapy-0.24.4-py2.7.egg
Processing dependencies for Scrapy
Searching for cryptography>=0.2.1
Reading https://pypi.python.org/simple/cryptography/
Best match: cryptography 0.5.4
Downloading https://pypi.python.org/packages/source/c/cryptography/cryptography-
0.5.4.tar.gz#md5=4fd1f10e9f99009a44667fabe7980aec
Processing cryptography-0.5.4.tar.gz
Writing c:\users\mubash~1\appdata\local\temp\easy_install-jjms3i\cryptography-0.
5.4\setup.cfg
Running cryptography-0.5.4\setup.py -q bdist_egg --dist-dir c:\users\mubash~1\ap
pdata\local\temp\easy_install-jjms3i\cryptography-0.5.4\egg-dist-tmp-ry6bwd
C:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option:
 'setup_requires'
  warnings.warn(msg)
_Cryptography_cffi_684bb40axf342507b.c
   Creating library c:\users\mubash~1\appdata\local\temp\easy_install-jjms3i\cry
ptography-0.5.4\cryptography\hazmat\primitives\__pycache__\Release\cryptography\
hazmat\primitives\__pycache__\_Cryptography_cffi_684bb40axf342507b.lib and objec
t c:\users\mubash~1\appdata\local\temp\easy_install-jjms3i\cryptography-0.5.4\cr
yptography\hazmat\primitives\__pycache__\Release\cryptography\hazmat\primitives\
__pycache__\_Cryptography_cffi_684bb40axf342507b.exp
_Cryptography_cffi_8f86901cxc1767c5a.c
   Creating library c:\users\mubash~1\appdata\local\temp\easy_install-jjms3i\cry
ptography-0.5.4\cryptography\hazmat\primitives\__pycache__\Release\cryptography\
hazmat\primitives\__pycache__\_Cryptography_cffi_8f86901cxc1767c5a.lib and objec
t c:\users\mubash~1\appdata\local\temp\easy_install-jjms3i\cryptography-0.5.4\cr
yptography\hazmat\primitives\__pycache__\Release\cryptography\hazmat\primitives\
__pycache__\_Cryptography_cffi_8f86901cxc1767c5a.exp
_Cryptography_cffi_4ed9e37dx4000d087.c
cryptography\hazmat\bindings\__pycache__\_Cryptography_cffi_4ed9e37dx4000d087.c(
194) : fatal error C1083: Cannot open include file: 'openssl/aes.h': No such fil
e or directory
error: c:\users\mubash~1\appdata\local\temp\easy_install-jjms3i\cryptography-0.5
.4\cryptography\hazmat\primitives\__pycache__\_Cryptography_cffi_684bb40axf34250
7b.pyd: Access is denied

最佳答案

我在安装不同的 python 应用程序时遇到了同样的错误。我缺少 OpenSSL 开发包,解决方法是:

sudo apt-get install libssl-dev

关于python - Scrapy 安装失败,出现错误 'cannot open include: ' openssl/aes.h ',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25568566/

相关文章:

python - 使用 Selenium 改进容器中元素的 Web 抓取

python - 带追加的列表累积

python - 更改 seaborn 热图的 xticklabels 字体大小

installation - 将 mathjax 支持添加到(本地)ikiwiki

python-3.x - 由于 OSError : [Errno2] No such file or directory 无法安装软件包

android - 运行命令 Android 终端模拟器。通过代码安装apk

python - 尝试用Python制作一个递归爬行蜘蛛。语法错误: non-keyword arg after keyword arg

python - GridSearchCV 在管道中将 fit_params 传递给 XGBRegressor 产生 "ValueError: need more than 1 value to unpack"

python - 检查字典列表中键的唯一值

python - Scrapy 打印字段但不填充 XML 文件