端口80上的端口错误

端口80上的端口错误

问题描述:

我在使用PyInstaller创建工作可执行文件时遇到问题。我已经能够成功地创建使用Python和瓶简单Web服务器 - 但是当我创建我的PyInstaller可执行文件并单击它 - 我得到以下输出:端口80上的端口错误

Alans-MBP:~ alanscarpa$ /Users/alanscarpa/Desktop/testSite/dist/testing ; exit; 
Bottle v0.13-dev server starting up (using WSGIRefServer())... 
Listening on http://0.0.0.0:80/ 
Hit Ctrl-C to quit. 

Traceback (most recent call last): 
    File "<string>", line 10, in <module> 
    File "/Users/alanscarpa/Desktop/testSite/build/testing/out00-PYZ.pyz/bottle", line 3093, in run 
    File "/Users/alanscarpa/Desktop/testSite/build/testing/out00-PYZ.pyz/bottle", line 2692, in run 
    File "/Users/alanscarpa/Desktop/testSite/build/testing/out00-PYZ.pyz/wsgiref.simple_server", line 151, in make_server 
    File "/Users/alanscarpa/Desktop/testSite/build/testing/out00-PYZ.pyz/SocketServer", line 420, in __init__ 
    File "/Users/alanscarpa/Desktop/testSite/build/testing/out00-PYZ.pyz/wsgiref.simple_server", line 48, in server_bind 
    File "/Users/alanscarpa/Desktop/testSite/build/testing/out00-PYZ.pyz/BaseHTTPServer", line 108, in server_bind 
    File "/Users/alanscarpa/Desktop/testSite/build/testing/out00-PYZ.pyz/SocketServer", line 434, in server_bind 
    File "/Users/alanscarpa/Desktop/testSite/build/testing/out00-PYZ.pyz/socket", line 224, in meth 
socket.error: [Errno 13] Permission denied 
logout 

[Process completed] 

第3行是完美的 - 和这是它应该看起来如果工作正常:

Bottle v0.13-dev server starting up (using WSGIRefServer())... 
    Listening on http://0.0.0.0:80/ 
    Hit Ctrl-C to quit. 

但之后的一切,弄乱了我的程序!

这里是我叫testing.py

#!/usr/bin/python  
from bottle import route, run, template 


@route('/testing') 
def index(): 
    return 'Hello..testing' 

run(host='0.0.0.0', port=80, debug=True) 

当我访问mylocalip /测试的Python文件 - 我得到的网页不可用。但是,如果我打开终端并写入:sudo/path/to/testing - 它完美的工作。 (我显然希望能够将可执行文件发送给某人,他们只需点击它即可运行,而不必使用终端)。

有什么建议吗?

编辑:我改变了我的端口到8080,它的工作!有人知道为什么

在大多数系统(至少BSD,OS X和Linux)上,您无法侦听1024以下没有root权限的端口。