1

I'm running Python3.6 intel anaconda distribution on a disconnected environment.

I installed the following wheels:

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 says all of my requirements are installed, but when I do an import flask, I get this error:

$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'
>>> 

So this makes no sense, because htmlentitydefs is a python2 thing, and I'm running on python3, and I installed everything from python2/python3 wheels.

What do I need to install to fix this?

vy32
  • 28,461
  • 37
  • 122
  • 246
  • hmm interesting, werkzeug [loads](https://github.com/pallets/werkzeug/blob/master/examples/plnt/utils.py#L54-L57) the python 3 version of name2codepoint first, then falls back to the python 2 version. I wonder if the python 3 version is fully installed. – IronMan Sep 17 '19 at 17:49

1 Answers1

2

If there is a directory called html in the current directory, python fails when it attempts to load the html module. I did a rmdir html in the current directory and this problem went away.

vy32
  • 28,461
  • 37
  • 122
  • 246