Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

python - I'm running Flask and it says there's no such file or directory

I'm using Ubuntu on Windows 10 and when I do "flask run" I get this error. I've searched google but it seems no one had this kind of problem. I do have socket.py file.

(api) ? api flask run:

* Serving Flask app "app.py"                                                                                            
* Environment: production                                                                                                 
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.                                                
* Debug mode: off
                                                                                                 

Traceback (most recent call last):
File "/home/luke/miniconda3/envs/api/bin/flask", line 10, in sys.exit(main())
File "/home/luke/miniconda3/envs/api/lib/python3.7/site-packages/flask/cli.py", line 967, in main cli.main(args=sys.argv[1:], prog_name="python -m flask" if as_module else None)
File "/home/luke/miniconda3/envs/api/lib/python3.7/site-packages/flask/cli.py", line 586, in main return super(FlaskGroup, self).main(*args, **kwargs)
File "/home/luke/miniconda3/envs/api/lib/python3.7/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx)
File "/home/luke/miniconda3/envs/api/lib/python3.7/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/luke/miniconda3/envs/api/lib/python3.7/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params)
File "/home/luke/miniconda3/envs/api/lib/python3.7/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/home/luke/miniconda3/envs/api/lib/python3.7/site-packages/click/decorators.py", line 73, in new_func return ctx.invoke(f, obj, *args, **kwargs) File "/home/luke/miniconda3/envs/api/lib/python3.7/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/home/luke/miniconda3/envs/api/lib/python3.7/site-packages/flask/cli.py", line 860, in run_command extra_files=extra_files,
File "/home/luke/miniconda3/envs/api/lib/python3.7/site-packages/werkzeug/serving.py", line 1052, in run_simple inner()
File "/home/luke/miniconda3/envs/api/lib/python3.7/site-packages/werkzeug/serving.py", line 1005, in inner fd=fd,
File "/home/luke/miniconda3/envs/api/lib/python3.7/site-packages/werkzeug/serving.py", line 848, in make_server host, port, app, request_handler, passthrough_errors, ssl_context, fd=fd
File "/home/luke/miniconda3/envs/api/lib/python3.7/site-packages/werkzeug/serving.py", line 740, in init HTTPServer.init(self, server_address, handler)
File "/home/luke/miniconda3/envs/api/lib/python3.7/socketserver.py", line 449, in init self.socket_type) File "/home/luke/miniconda3/envs/api/lib/python3.7/socket.py", line 151, in init
_socket.socket.init(self, family, type, proto, fileno) FileNotFoundError: [Errno 2] No such file or directory


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

1 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...