[英]File Error while running Simple Flask program
Traceback (most recent call last):
File "<ipython-input-6-5b3985f98f53>", line 1, in <module>
runfile('D:/document/VIT/Internship/IBM Externship/Notebooks/flask/first.py', wdir='D:/document/VIT/Internship/IBM Externship/Notebooks/flask')
File "D:\Anaconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
execfile(filename, namespace)
File "D:\Anaconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "D:/document/VIT/Internship/IBM Externship/Notebooks/flask/first.py", line 3, in <module>
from flask import Flask
File "D:\Anaconda\lib\site-packages\flask\__init__.py", line 21, in <module>
from .app import Flask
File "D:\Anaconda\lib\site-packages\flask\app.py", line 32, in <module>
from werkzeug.wrappers import BaseResponse
ImportError: cannot import name 'BaseResponse' from 'werkzeug.wrappers' (D:\Anaconda\lib\site-packages\werkzeug\wrappers\__init__.py)
這是我得到的錯誤。 我對 Flask 很陌生,並試圖運行程序,如下所示:
from flask import Flask
app= Flask(__name__)
@app.route('/')
def index():
return "Henlooo"
if __name__=='__main__':
app.run(debug=False)
請告訴我我需要在列出的文件中更改什么
試試這個:使用python -m pip uninstall werkzeug
,然后運行python -m pip install werkzeug
如果您的項目需要特定版本運行python -m pip install werkzeug==2.0.3
記得將版本更改為您的版本。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.