使用Scrapy时遇到:UserWarning: You do not have a working installation of the service_identity module

当我们使用scrapy进行爬虫项目的操作时,出现如下错误:
UserWarning: You do not have a working installation of the service_identity module: 'cannot import name 'opentype''. Please install it from https://pypi.python.org/pypi/service_identity 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.

如图:

UserWarning.png

从提示错误来看,我们需要安装一个模块service_identity,根据提示地址(https://pypi.python.org/pypi/service_identity)来安装,那么我们按照这个来进行安装能解决问题吗?可以试一下。

service_identity.png

我们可以直接通过命令行下载,
sudo pip3 install service_identity-17.0.0-py2.py3-none-any.whl

如果上面的方法没能解决问题,很大可能是有些包的版本不一样导致的,这个时候我们可以用下面这行代码来强制更新。
sudo pip3 install service_identity --force --upgrade

至此,恭喜您成功解决问题,祝您生活愉快!

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容