PermissionError:[Errno 13]权限被拒绝的Flask.run() [英] PermissionError: [Errno 13] Permission denied Flask.run()

查看:45
本文介绍了PermissionError:[Errno 13]权限被拒绝的Flask.run()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用python 3运行MacOSX.该文件夹和文件有755,但我也曾在777中进行过运气测试.我的问题是,如果我拥有正确的权限,为什么它不让我在没有sudo的情况下运行.还是我的设置不正确?

I am running MacOS X with python 3. The folder and files have 755 but I have also tested it in 777 with no luck. My question is if I have the right permissions why does it not let me run without sudo. Or are my settings incorrect?

cris-mbp:ProjectFolder cris$ python3 zbo.py 
Traceback (most recent call last):
  File "zbo.py", line 9, in <module>
    app.run(host="127.0.0.1",port=81,debug=True)
  File "/usr/local/lib/python3.5/site-packages/flask/app.py", line 843, in run
    run_simple(host, port, self, **options)
  File "/usr/local/lib/python3.5/site-packages/werkzeug/serving.py", line 677, in run_simple
    s.bind((hostname, port))
PermissionError: [Errno 13] Permission denied
cris-mbp:ProjectFolder cris$ sudo python3 zbo.py 
 * Running on http://127.0.0.1:81/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger pin code: 106-133-233

推荐答案

您正在尝试在

You're trying to run the app on a privileged port (81) - if you use a higher port such as 5000 you won't need sudo privileges.

这篇关于PermissionError:[Errno 13]权限被拒绝的Flask.run()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆