o-u-o
2022-06-08 23:16
采纳率: 50%
浏览 43

import flask from Flask 出现syntaxerror错误

from flask import Flask
app=Flask(name)
@app.route("/")
def index():
return "1"
if name=="main":
app.run()
报错如下:
/usr/bin/python3.5 /home/hadoop/PycharmProjects/untitled/scripts/app.py
Traceback (most recent call last):
File "/home/hadoop/PycharmProjects/untitled/scripts/app.py", line 1, in
from flask import Flask
File "/usr/local/lib/python3.5/dist-packages/flask/init.py", line 3, in
from werkzeug.exceptions import abort as abort
File "/usr/local/lib/python3.5/dist-packages/werkzeug/init.py", line 1, in
from .serving import run_simple as run_simple
File "/usr/local/lib/python3.5/dist-packages/werkzeug/serving.py", line 151
server: "BaseWSGIServer"
^
SyntaxError: invalid syntax
qwq网上搜了一圈没找到差不多的

2条回答 默认 最新

相关推荐 更多相似问题