免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 10019 | 回复: 6
打印 上一主题 下一主题

Windows环境下运行python helloworld简单代码报错“Permission denied” [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-02-19 15:37 |只看该作者 |倒序浏览
5可用积分
这是运行的命令    E:\Google>dev_appserver.py helloworld/

详细报错信息如下:

WARNING  2009-02-19 07:30:46,394 datastore_file_stub.py] Could not read datastor
e data from c:\docume~1\fuhao\locals~1\temp\dev_appserver.datastore
WARNING  2009-02-19 07:30:46,394 datastore_file_stub.py] Could not read datastor
e data from c:\docume~1\fuhao\locals~1\temp\dev_appserver.datastore.history
Traceback (most recent call last):
  File "C:\Program Files\Google\google_appengine\dev_appserver.py", line 50, in
<module>
    execfile(script_path, globals())
  File "C:\Program Files\Google\google_appengine\google/appengine/tools/dev_apps
erver_main.py", line 351, in <module>
    sys.exit(main(sys.argv))
  File "C:\Program Files\Google\google_appengine\google/appengine/tools/dev_apps
erver_main.py", line 330, in main
    require_indexes=require_indexes)
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_apps
erver.py", line 2645, in CreateServer
    return BaseHTTPServer.HTTPServer((serve_address, port), handler_class)
  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')

新新手,不知道这是怎么回事,请前辈们给予指点下方向,谢谢!!

论坛徽章:
0
2 [报告]
发表于 2009-02-19 15:40 |只看该作者

回复 #1 fuowen20 的帖子

windows不是不能用 \要用\\         \不是转意字符吗
我不知道啊 我小白我猜的

论坛徽章:
0
3 [报告]
发表于 2009-02-19 16:22 |只看该作者

论坛徽章:
0
4 [报告]
发表于 2009-02-19 18:16 |只看该作者
看E文好累……

论坛徽章:
0
5 [报告]
发表于 2009-02-20 08:42 |只看该作者
Socket error (#10013): Permission denied

An attempt was made to access a socket in a way forbidden by its access permissions. An example is using a broadcast address for sendto without broadcast permission being set using setsockopt(SO_BROADCAST).

Another possible reason for the WSAEACCES error is that when the bind function is called (on Windows NT 4 SP4 or later), another application, service, or kernel mode driver is bound to the same address with exclusive access. Such exclusive access is a new feature of Windows NT 4 SP4 and later, and is implemented by using the SO_EXCLUSIVEADDRUSE option.

论坛徽章:
0
6 [报告]
发表于 2009-02-20 08:47 |只看该作者
是不是server_address设置的有问题?或者端口被占用了?

[ 本帖最后由 luffy.deng 于 2009-2-20 11:31 编辑 ]

论坛徽章:
0
7 [报告]
发表于 2009-02-20 11:30 |只看该作者
原帖由 fuowen20 于 2009-2-19 15:37 发表
这是运行的命令    E:\Google>dev_appserver.py helloworld/

详细报错信息如下:

WARNING  2009-02-19 07:30:46,394 datastore_file_stub.py] Could not read datastor
e data from c:\docume~1\fuhao\l ...

你是不是已经在那个端口运行了一个程序了?
设置一下地址重用。。。。

bind之前加上这句
srvsock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
srvsock.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)

[ 本帖最后由 alexhappy 于 2009-2-20 11:33 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP