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.
The "permission denied" error is occurring on the bind
call; this has nothing to do with directory permissions.
You're attempting to bind to port 81 (an odd choice), which is a privileged port (one that is less than 1024). This means you need to run it as root.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With