What causes Python socket error?

一曲冷凌霜 提交于 2019-12-17 23:46:20

问题


  File "C:\Python25\lib\SocketServer.py", line 330, in __init__
    self.server_bind()
  File "C:\Python25\lib\BaseHTTPServer.py", line 101, in server_bind
    SocketServer.TCPServer.server_bind(self)
  File "C:\Python25\lib\SocketServer.py", line 341, in server_bind
    self.socket.bind(self.server_address)
  File "<string>", line 1, in bind
socket.error: (10013, 'Permission denied')

I tried to start up the Google App Engine development server and received this error the first time I tried to run it. Any ideas? I'm new to python.


回答1:


It might be possible that you are trying to run on a port the current user account does not have permission to bind to. This could be port 80 or something. Try increasing the portnumber or use a user with sufficient privileges.

Hope this helps




回答2:


I wonder why the error is not "Port already in use". I kind of know the answer but I should not need to use SO to know it. :) – Oscar Reyes May 13 at 19:09

The port is not in use, (in UNIX) you need to be superuser to listen on any port < 1024.




回答3:


I am assuming your are using the default port assigned by gae sdk so you might want to ensure that it is not used by any other programs.




回答4:


run it as follow. This should work

python -m 8888

if this does not work. Try other numbers like 8080.



来源:https://stackoverflow.com/questions/550032/what-causes-python-socket-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!