我在 iOS 上使用 Pythonista 应用程序,即使使用最基本的代码也无法使 Flask 模块工作。
我的代码是:
from flask import Flask
Flaskapp = Flask(__name__)
@Flaskapp.route('/')
def helloWorld():
return 'Woala'
Flaskapp.run(debug=True)
但继续收到:
* Serving Flask app "app" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
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 "/private/var/mobile/Library/Mobile Documents/iCloud~com~omz-software~Pythonista3/Documents/app.py", line 9, in <module>
Flaskapp.run(debug=True)
File "/private/var/mobile/Containers/Shared/AppGroup/C4F03A05-D634-4F19-865F-6072E8D6DC38/Pythonista3/Documents/site-packages-3/flask/app.py", line 990, in run
run_simple(host, port, self, **options)
File "/private/var/mobile/Containers/Shared/AppGroup/C4F03A05-D634-4F19-865F-6072E8D6DC38/Pythonista3/Documents/site-packages-3/werkzeug/serving.py", line 1007, in run_simple
run_with_reloader(inner, extra_files, reloader_interval, reloader_type)
File "/private/var/mobile/Containers/Shared/AppGroup/C4F03A05-D634-4F19-865F-6072E8D6DC38/Pythonista3/Documents/site-packages-3/werkzeug/_reloader.py", line 332, in run_with_reloader
sys.exit(reloader.restart_with_reloader())
File "/private/var/mobile/Containers/Shared/AppGroup/C4F03A05-D634-4F19-865F-6072E8D6DC38/Pythonista3/Documents/site-packages-3/werkzeug/_reloader.py", line 176, in restart_with_reloader
exit_code = subprocess.call(args, env=new_environ, close_fds=False)
File "/var/containers/Bundle/Application/E373BC34-F149-4EF5-9D0E-5CD807AB0771/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/subprocess.py", line 268, in call
with Popen(*popenargs, **kwargs) as p:
File "/var/containers/Bundle/Application/E373BC34-F149-4EF5-9D0E-5CD807AB0771/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/subprocess.py", line 708, in __init__
restore_signals, start_new_session)
File "/var/containers/Bundle/Application/E373BC34-F149-4EF5-9D0E-5CD807AB0771/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/subprocess.py", line 1261, in _execute_child
restore_signals, start_new_session, preexec_fn)
PermissionError: [Errno 1] Operation not permitted
我已经在 launch_stash.py 中安装了烧瓶槽 pip