股票

ImportError: No module named singledispatch

Debian 9

Python 2.7.13

Tornado 4.3

安装好Tornado 4.3后,进行hello网页测试的时候,输入 python hello.py,显示错误:

ImportError: No module named singledispatch

无法执行下去。

查询了一下,有个解释不错:

Somehow you installed Tornado without its required dependencies. Install them with:

python -m pip install singledispatch backports_abc

Here’s the list of new dependencies in Tornado 4.3.

在Tornado 4.3中有一些更新,

  • Tornado has several new dependencies: ordereddict on Python 2.6, singledispatch on all Python versions prior to 3.4 (This was an optional dependency in prior versions of Tornado, and is now mandatory), and backports_abc>=0.4 on all versions prior to 3.5. These dependencies will be installed automatically when installing with pip or setup.py install. These dependencies will not be required when running on Google App Engine.

就是Python 3.4版本之前,都要手动加入 singledispatch这个库,在命令行导入后,再执行 python hello.py 就可以正常运行了。

打赏
原文链接:,转发请注明来源!

发表评论