logo头像
Snippet 博客主题

python爬虫框架scrapy安装(一)

1.执行命令安装

1
[root@localhost]/home/lzq/python_project/python_book_code# pip3 install scrapy

执行上面命令后出现了以下错误

1
2
Could not find a version that satisfies the requirement Twisted>=13.1.0 (from scrapy) (from versions: )
No matching distribution found for Twisted>=13.1.0 (from scrapy)

这是因为Twisted没有安装

1.1安装Twisted

wget -c https://twistedmatrix.com/Releases/Twisted/16.6/Twisted-16.6.0.tar.bz2

1
[root@localhost]/home/lzq/python_project/python_book_code#  wget -c https://twistedmatrix.com/Releases/Twisted/16.6/Twisted-16.6.0.tar.bz2
1
2
[root@localhost]/home/lzq/python_project/python_book_code# cd Twisted-16.6.0
[root@localhost]/home/lzq/python_project/python_book_code/Twisted-16.6.0# python setup.py install

执行完上面的安装命令出现下面这串内容表示安装成功了

Finished processing dependencies for Twisted==16.6.0

然后在执行安装scrapy的命令就可以了

1.2安装scrapy

1
[root@localhost]/home/lzq/python_project/python_book_code# pip3 install scrapy

出现下面的内容没有ERROR就表示安装成功了

Installing collected packages: six, w3lib, PyDispatcher, cssselect, queuelib, lxml, parsel, pyasn1, pyasn1-modules, pycparser, cffi, asn1crypto, cryptography, attrs, service-identity, pyOpenSSL, scrapy
Running setup.py install for PyDispatcher … done
Running setup.py install for pycparser … done
Successfully installed PyDispatcher-2.0.5 asn1crypto-0.24.0 attrs-19.1.0 cffi-1.12.3 cryptography-2.7 cssselect-1.0.3 lxml-4.3.4 parsel-1.5.1 pyOpenSSL-19.0.0 pyasn1-0.4.5 pyasn1-modules-0.2.5 pycparser-2.19 queuelib-1.5.0 scrapy-1.7.1 service-identity-18.1.0 six-1.12.0 w3lib-1.20.0

微信打赏