我在断开连接的环境中运行Python3.6 intel anaconda发行版。
我安装了以下轮子:
Click-7.0-py2.py3-none-any.whl
Flask-1.1.1-py2.py3-none-any.whl
itsdangerous-1.1.0-py2.py3-none-any.whl
Jinja2-2.10.1-py2.py3-none-any.whl
Werkzeug-0.15.6-py2.py3-none-any.whl
pip说我的所有要求都已安装,但是当我执行import flask
时,出现此错误:
$python
Python 3.6.8 |Intel Corporation| (default, Jan 15 2019, 04:34:13)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux
Type "help", "copyright", "credits" or "license" for more information.
Intel(R) Distribution for Python is brought to you by Intel Corporation.
Please check out: https://software.intel.com/en-us/python-distribution
>>> import flask
Traceback (most recent call last):
File "/intelpython3_2019.2/lib/python3.6/site-packages/werkzeug/utils.py", line 31, in <module>
from html.entities import name2codepoint
ModuleNotFoundError: No module named 'html.entities'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/intelpython3_2019.2/lib/python3.6/site-packages/flask/__init__.py", line 16, in <module>
from werkzeug.exceptions import abort
File "/intelpython3_2019.2/lib/python3.6/site-packages/werkzeug/__init__.py", line 233, in <module>
__import__("werkzeug.exceptions")
File "/intelpython3_2019.2/lib/python3.6/site-packages/werkzeug/exceptions.py", line 73, in <module>
from .wrappers import Response
File "/intelpython3_2019.2/lib/python3.6/site-packages/werkzeug/wrappers/__init__.py", line 21, in <module>
from .accept import AcceptMixin
File "/intelpython3_2019.2/lib/python3.6/site-packages/werkzeug/wrappers/accept.py", line 5, in <module>
from ..utils import cached_property
File "/intelpython3_2019.2/lib/python3.6/site-packages/werkzeug/utils.py", line 33, in <module>
from htmlentitydefs import name2codepoint
ModuleNotFoundError: No module named 'htmlentitydefs'
>>>
所以这没有任何意义,因为htmlentitydefs
是python2的东西,并且我在python3上运行,并且我安装了python2 / python3轮子上的所有东西。
我需要安装什么来解决此问题?
答案 0 :(得分:0)
如果当前目录中存在一个名为html
的目录,则python尝试加载html模块时将失败。我在当前目录中做了一个rmdir html
,这个问题就消失了。