老师,我在看4-8节视频时,在centos上运行你讲的程序不开启debug模式可以巡行,一开启就报错,这是怎么回事?
来源:4-8 数据库ORM
blood_kyo
2019-05-06
3回答
-
blood_kyo
提问者
2019-05-06
#我的源代码是Hello.py,就是4-3节视频讲的那个程序
# -*- coding: utf-8 -*-
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World'
if __name__ =='__main__':
app.run(host='0.0.0.0',debug=True)00 -
blood_kyo
提问者
2019-05-06
C(imooc) [root@localhost Test]# python Hello.py
* Serving Flask app "Hello" (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://0.0.0.0:5000/ (Press CTRL+C to quit)
* Restarting with stat
Traceback (most recent call last):
File "Hello.py", line 11, in <module>
app.run(host='0.0.0.0',debug=True)
File "/root/imooc/lib/python3.5/site-packages/flask/app.py", line 943, in run
run_simple(host, port, self, **options)
File "/root/imooc/lib/python3.5/site-packages/werkzeug/serving.py", line 988, in run_simple
run_with_reloader(inner, extra_files, reloader_interval, reloader_type)
File "/root/imooc/lib/python3.5/site-packages/werkzeug/_reloader.py", line 332, in run_with_reloader
sys.exit(reloader.restart_with_reloader())
File "/root/imooc/lib/python3.5/site-packages/werkzeug/_reloader.py", line 176, in restart_with_reloader
exit_code = subprocess.call(args, env=new_environ, close_fds=False)
File "/usr/local/python3/lib/python3.5/subprocess.py", line 560, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/local/python3/lib/python3.5/subprocess.py", line 950, in __init__
restore_signals, start_new_session)
File "/usr/local/python3/lib/python3.5/subprocess.py", line 1540, in _execute_child
raise child_exception_type(errno_num, err_msg)
OSError: [Errno 8] Exec format error
022019-05-07 -
编程浪子
2019-05-06
你好
请贴出报错信息
032019-05-06
相似问题