Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
584 views
in Technique[技术] by (71.8m points)

python - Python错误加载烧瓶:ModuleNotFoundError:没有名为“ flask”的模块(Python error loading flask: ModuleNotFoundError: No module named 'flask')

I'm really new to Python and I'm trying to do a tutorial on using flask.

(我真的是Python的新手,我正在尝试做一个使用flask的教程。)

When I run the below code:

(当我运行以下代码时:)

from flask import Flask app = Flask(__name__)

@app.route("/") def home(): return "Hello, World!"

I get the following error message:

(我收到以下错误消息:)

Traceback (most recent call last): File "/Users/myname/Documents/PycharmProjects/flask/test_webapp.py", line 1, in <module> from flask import Flask ModuleNotFoundError: No module named 'flask

This doesn't make any sense to me as when I run:

(这对我来说没有意义,就像我跑步时一样:)

python -m pip list

Flask 1.1.1 is on the list.

(Flask 1.1.1在列表中。)

I am using Python version 3.7.4.

(我正在使用Python版本3.7.4。)

I realise this questions has been asked before but after carefully reading through I can't find the correct answer.

(我知道之前曾有人问过这个问题,但仔细阅读后我找不到正确的答案。)

I realise this is quite basic but any help would be really appreciated!

(我意识到这是非常基本的,但是任何帮助将不胜感激!)

  ask by Mrmoleje translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...