我正在尝试使用命令sudo pip install scrapy
安装Scrapy,但是我遇到了一个错误信息,其中最后几行如下:
build/temp.linux-x86_64-2.7/_openssl.c:429:30: fatal error: openssl/opensslv.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-tVcVY7/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-zyty58-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-tVcVY7/cryptography/
错误似乎与OpenSSL有关,需要根据http://doc.scrapy.org/en/latest/intro/install.html进行安装。然而,如果我运行
sudo apt-get install openssl
,我会收到一条消息,似乎表明它已经安装了:Reading package lists... Done
Building dependency tree
Reading state information... Done
openssl is already the newest version (1.0.2g-1ubuntu4.1).
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-21 linux-headers-4.4.0-21-generic linux-headers-4.4.0-22
linux-headers-4.4.0-22-generic linux-image-4.4.0-21-generic
linux-image-4.4.0-22-generic linux-image-extra-4.4.0-21-generic
linux-image-extra-4.4.0-22-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 135 not upgraded.
如何解决安装scrapy的问题?