Ubuntu安装Scrapy遇到的错误

安装scrapy框架之前需要安装很多的依赖包
这个按照官方文档来就可以。不再赘述
说说今天遇到的问题。报错如下

python@ubuntu:~$ scrapy
:0: 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.
Scrapy 1.5.0 - no active project

其实这种情况下scrapy已经安装好了 可以使用 只是有部分功能 有影响就是其中提到的 service_identity模块。其实这个模块是已经安装了的。但是为什么还会报错呢。耗费了我两个小时 各种发帖 搜索。终于在一位大神那里找到了答案
原因是不知道因为什么原因导致本机上的service_identity模块太老旧,而你通过install安装的时候 不会更新到最新版本
通过

pip3 install service_identity --force --upgrade

强制更新模块到最新版本问题解决。

    原文作者:Rumple
    原文地址: https://www.jianshu.com/p/1b7c05060d2f
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞