Home > other >  [master come in] python3.6 import after the flask to run the program always tip can't find the
[master come in] python3.6 import after the flask to run the program always tip can't find the

Time:11-27

To study the python web framework, using flask. Write a few lines of code, but always error, to consult the bosses:
The code is as follows:
 
The from flask import flask
App=Flask (__name__)
@ app. The route ('/')
Def the hello () - & gt; STR:
Return "hello world from flask '
App. The run ()

Flask module is installed, running after an error below
 
Traceback (the most recent call last) :
The File "/usr/local/lib/python3.6/site - packages/werkzeug/utils. Py", 30, the line in & lt; module>
The from HTML. Entities import name2codepoint
The File "/opt/HTML/HTML. Py", line 1, the in & lt; module>
The from flask import flask
ImportError: always import a name 'Flask'

During handling of the above exception, another exception occurred:

Traceback (the most recent call last) :
The File "HTML. Py", line 1, the in & lt; module>
The from flask import flask
The File "/usr/local/lib64/python3.6/site - packages/flask/set py", line 16, the in & lt; module>
The from werkzeug. Exceptions import abort
The File "/usr/local/lib/python3.6/site - packages/werkzeug/set py", line 15, in & lt; module>
From the serving import run_simple
The File "/usr/local/lib/python3.6/site - packages/werkzeug/serving. Py", line 51, the in & lt; module>
From the exceptions import InternalServerError
The File "/usr/local/lib/python3.6/site - packages/werkzeug/exceptions. Py", line 68, in & lt; module>
From the utils to import the escape
The File "/usr/local/lib/python3.6/site - packages/werkzeug/utils. Py", line 32, in & lt; module>
The from htmlentitydefs import name2codepoint
ModuleNotFoundError: No module named 'htmlentitydefs'

Why can't always prompt import flask module, and is ModuleNotFoundError: No module named 'htmlentitydefs' this is what the devil? A great god, please grant instruction!!!!!

CodePudding user response:

Take a look at your/opt/HTML/
Have a flask directory or directory flask. Py files,

  • Related