最开始出现的是:
pip3 install scrapy
可能是scrapy中的s没有用大写,应该是
pip3 install Scrapy
然后安装的时候又出现一个新的问题:
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/w0/7vpt0hs11t3236mn4nrnwn_r0000gn/T/pip-install-k37aohd3/Twisted/
我看到有/private/出现,可能是权限问题:
所以我更改了一下
sudo pip3 install Scrapy
然后又出现一个新的错误:
Could not find a version that satisfies the requirement w3lib>=1.17.0 (from Scrapy) (from versions: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7.0, 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.10.0)
No matching distribution found for w3lib>=1.17.0 (from Scrapy)
看了一下,应该是w3lib的版本太低,所以我就更新一下
pip3 install w3lib
可以看到更新到1.20版本
Installing collected packages: six, w3lib
Successfully installed six-1.12.0 w3lib-1.20.0
然后继续安装
sudo pip3 install Scrapy
最后安装成功查看:
pip3 list
然后我的结果是:
Package Version
---------------- -------
asn1crypto 0.24.0
attrs 18.2.0
Automat 0.7.0
cffi 1.11.5
constantly 15.1.0
cryptography 2.5
cssselect 1.0.3
hyperlink 18.0.0
idna 2.8
incremental 17.5.0
lxml 4.3.1
parsel 1.5.1
pip 19.0.2
pyasn1 0.4.5
pyasn1-modules 0.2.4
pycparser 2.19
PyDispatcher 2.0.5
PyHamcrest 1.9.0
pyOpenSSL 19.0.0
queuelib 1.5.0
Scrapy 1.6.0
service-identity 18.1.0
setuptools 40.8.0
six 1.12.0
Twisted 18.9.0
w3lib 1.20.0
wheel 0.33.0
zope.interface 4.6.0
这里我们就得到了想要的结果