Python Bottle安装

时间:2014-03-20 16:55:25

标签: python python-2.7

我是Python新手。我下载了#34; bottle.py"并将其放在我的项目目录中。我创建了一个简单的" helloworld.py" 。 Helloworld.py是

from bottle import route, run

@route('/hello')

def hello():
    return "Hello World!"

run(host='localhost', port=8080, debug=True)

当我运行此文件时,弹出错误:

Traceback (most recent call last):
  File "C:/Users/kattula/PycharmProjects/Sample Codes/helloworld.py", line 6, in <module>
    run(host='localhost', port=8080, debug=True)
  File "C:\Users\kattula\PycharmProjects\Sample Codes\bottle.py", line 3112, in run
    server.run(app)
  File "C:\Users\kattula\PycharmProjects\Sample Codes\bottle.py", line 2766, in run
    srv = make_server(self.host, self.port, app, server_cls, handler_cls)
  File "C:\Python27\lib\wsgiref\simple_server.py", line 144, in make_server
    server = server_class((host, port), handler_class)
  File "C:\Python27\lib\SocketServer.py", line 408, in __init__
    self.server_bind()
  File "C:\Python27\lib\wsgiref\simple_server.py", line 48, in server_bind
    HTTPServer.server_bind(self)
  File "C:\Python27\lib\BaseHTTPServer.py", line 108, in server_bind
    SocketServer.TCPServer.server_bind(self)
  File "C:\Python27\lib\SocketServer.py", line 419, in server_bind
    self.socket.bind(self.server_address)
  File "C:\Python27\lib\socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
  socket.error: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions

Process finished with exit code 1

什么是错误。救命 !。提前致谢。 `

1 个答案:

答案 0 :(得分:0)

报告的错误代码(10013)是Permission Denied,所以我猜你在使用UAC的Windows下运行。看看这篇文章Admin privileges for script