当使用debug = True运行时,烧瓶应用程序会引发“ Exec格式错误”

时间:2019-05-07 19:31:24

标签: python flask

我正在关注一些在线教程,但没关系,我不能使调试工作...任何人都可以帮忙吗?

from flask import Flask , request, jsonify

#Init Flask
app = Flask(__name__)


#Run Server
if __name__ == '__main__':
    app.run(debug=True)

终端响应。

(pyapi) mmestre@DESKTOP-F58KAFC:/mnt/d/Projects/Python/pyapi$ python app.py

 * Serving Flask app "app" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: on
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
Traceback (most recent call last):
  File "app.py", line 9, in <module>
    app.run(debug=True)
  File "/home/mmestre/.local/share/virtualenvs/pyapi-U_pT_kGf/lib/python3.6/site-packages/flask/app.py", line 943, in run
    run_simple(host, port, self, **options)
  File "/home/mmestre/.local/share/virtualenvs/pyapi-U_pT_kGf/lib/python3.6/site-packages/werkzeug/serving.py", line 988, in run_simple
    run_with_reloader(inner, extra_files, reloader_interval, reloader_type)
  File "/home/mmestre/.local/share/virtualenvs/pyapi-U_pT_kGf/lib/python3.6/site-packages/werkzeug/_reloader.py", line 332, in run_with_reloader
    sys.exit(reloader.restart_with_reloader())
  File "/home/mmestre/.local/share/virtualenvs/pyapi-U_pT_kGf/lib/python3.6/site-packages/werkzeug/_reloader.py", line 176, in restart_with_reloader
    exit_code = subprocess.call(args, env=new_environ, close_fds=False)
  File "/usr/lib/python3.6/subprocess.py", line 267, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/mnt/d/Projects/Python/pyapi/app.py'

(pyapi) mmestre@DESKTOP-F58KAFC:/mnt/d/Projects/Python/pyapi$

0 个答案:

没有答案