我正在尝试运行 bottle py 但收到此错误:
Traceback (most recent call last):
File "/home/pi/Desktop/gggg.py", line 176, in <module>
run(host='somehost', port=81)
File "/usr/lib/python2.7/dist-packages/bottle.py", line 2426, in run
server.run(app)
File "/usr/lib/python2.7/dist-packages/bottle.py", line 2123, in run
srv = make_server(self.host, self.port, handler, **self.options)
File "/usr/lib/python2.7/wsgiref/simple_server.py", line 144, in make_server
server = server_class((host, port), handler_class)
File "/usr/lib/python2.7/SocketServer.py", line 419, in __init__
self.server_bind()
File "/usr/lib/python2.7/wsgiref/simple_server.py", line 48, in server_bind
HTTPServer.server_bind(self)
File "/usr/lib/python2.7/BaseHTTPServer.py", line 108, in server_bind
SocketServer.TCPServer.server_bind(self)
File "/usr/lib/python2.7/SocketServer.py", line 430, in server_bind
self.socket.bind(self.server_address)
File "/usr/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
error: [Errno 13] Permission denied
>>>
我以“pi”身份登录。以 root 用户身份登录可以解决问题。我的问题是瓶子 py 和 python 需要运行哪些权限(哪些文件夹和哪些权限)?
编辑:
不确定是否重要,但我的 python 文件在桌面目录中。我还将文件夹/子文件夹的权限设置为所有人读写。