twisted 运行出现 service_identity module warning.

运行程序时报出了如下警告,

:0: UserWarning: You do not have a working installation of the service_identity
module: 'No module named service_identity'. Please install it from i.python.org/pypi/service_identity> and make sure all of its dependencies are sa
tisfied. Without the service_identity module and a recent enough pyOpenSSL to s
upport it, Twisted can perform only rudimentary TLS client hostname verification
. Many valid certificate/hostname mappings may be rejected.

从字面意思就是说缺少service_identity模块。
好吧 安装一下试试:

pip install service_identity

提示:

Requirement already satisfied

....:)

Stack Overflow上有类似问题

  • https://stackoverflow.com/questions/24089484/python-no-module-named-service-identity
  • https://stackoverflow.com/questions/23959336/scrapy-install-version-error

但是都是安装service_identity模块。尴尬。

仔细研究了一下之前的提示信息: 提到

make sure all of its dependencies are sa tisfied.

service_identity的文档里找找看。 存在几个依赖包.

  • attrs
  • pyOpenSSL
  • pyasn1
  • pyasn1-modules

逐一安装试试,发现果然缺少了一个依赖pyasn1-modules.

教训:
-- 小心依赖。

你可能感兴趣的:(twisted 运行出现 service_identity module warning.)