首先安装pip: sudo apt-get install python-pip
接着安装scrapy依赖包:
1、 sudo apt-get install python-dev
2、sudo apt-get install libevent-dev
3、 sudo apt-get install libssl-dev
最后执行scrapy安装命令
--sudo pip install scrapy(python2的安装命令)
--sudo pip3 install scrapy(python3的安装命令)
安装完后,可以输入scrapy version查看是否安装成功
如果出现了以下的错误信息,需要执行这条命令:
--sudo pip3 install service_identity --force --upgrade
:0: UserWarning: You do not have a working installation of the service_identity module: 'cannot import name 'opentype''. Please install it from and make sure all of its dependencies are satisfied. Without the service_identity module, Twisted can perform only rudimentary TLS client hostname verification. Many valid certificate/hostname mappings may be rejected.
网友评论