我在启动CherryPy时遇到了一些麻烦,我无法弄清楚为什么我不断收到此错误。以下是有日志输出的版本和相关代码。CherryPy无法启动
的Python 2.7.6 的CherryPy 3.5.0(通过PIP)
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
STATIC_DIR = os.path.join(CURRENT_DIR, "static")
CONFIG = {
'/static': {
'tools.staticdir.on': True,
'tools.staticdir.dir': STATIC_DIR
}
}
Daemonizer(cherrypy.engine).subscribe() # When we start, do it as a daemon process
cherrypy.config.update({'server.socket_host': '127.0.0.1','server.socket_port': 8080,'log.error_file': 'site.log'}) # Listen on all local IPs (default is 8080)
cherrypy.tree.mount(MyWebServer(), '/', config=CONFIG) # Mount the app on the root
cherrypy.engine.start()
这里的日志输出:
[05/Jul/2014:10:28:01] ENGINE Bus STARTING
[05/Jul/2014:10:28:01] ENGINE Forking once.
[05/Jul/2014:10:28:01] ENGINE Forking twice.
[05/Jul/2014:10:28:01] ENGINE Daemonized to PID: 21464
[05/Jul/2014:10:28:01] ENGINE Started monitor thread 'Monitor'.
[05/Jul/2014:10:28:01] ENGINE Started monitor thread 'Autoreloader'.
[05/Jul/2014:10:28:01] ENGINE Started monitor thread 'Monitor'.
[05/Jul/2014:10:28:01] ENGINE Started monitor thread 'Monitor'.
[05/Jul/2014:10:28:01] ENGINE Started monitor thread 'Monitor'.
[05/Jul/2014:10:28:01] ENGINE Started monitor thread '_TimeoutMonitor'.
[05/Jul/2014:10:28:01] ENGINE Error in 'start' listener <bound method Server.start of <cherrypy._cpserver.Server object at 0x10cf2d190>>
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/cherrypy/process/wspbus.py", line 205, in publish
output.append(listener(*args, **kwargs))
File "/Library/Python/2.7/site-packages/cherrypy/_cpserver.py", line 167, in start
self.httpserver, self.bind_addr = self.httpserver_from_self()
File "/Library/Python/2.7/site-packages/cherrypy/_cpserver.py", line 158, in httpserver_from_self
httpserver = _cpwsgi_server.CPWSGIServer(self)
File "/Library/Python/2.7/site-packages/cherrypy/_cpwsgi_server.py", line 43, in __init__
accepted_queue_timeout=self.server_adapter.accepted_queue_timeout,
TypeError: __init__() got an unexpected keyword argument 'accepted_queue_size'
[05/Jul/2014:10:28:01] ENGINE Shutting down due to error in start listener:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/cherrypy/process/wspbus.py", line 243, in start
self.publish('start')
File "/Library/Python/2.7/site-packages/cherrypy/process/wspbus.py", line 223, in publish
raise exc
ChannelFailures: TypeError("__init__() got an unexpected keyword argument 'accepted_queue_size'",)
[05/Jul/2014:10:28:01] ENGINE Bus STOPPING
[05/Jul/2014:10:28:01] ENGINE HTTP Server None already shut down
[05/Jul/2014:10:28:01] ENGINE Stopped thread '_TimeoutMonitor'.
[05/Jul/2014:10:28:01] ENGINE Stopped thread 'Monitor'.
[05/Jul/2014:10:28:01] ENGINE Stopped thread 'Monitor'.
[05/Jul/2014:10:28:01] ENGINE Stopped thread 'Autoreloader'.
[05/Jul/2014:10:28:01] ENGINE Stopped thread 'Monitor'.
[05/Jul/2014:10:28:01] ENGINE Stopped thread 'Monitor'.
[05/Jul/2014:10:28:01] ENGINE Bus STOPPED
[05/Jul/2014:10:28:01] ENGINE Bus EXITING
[05/Jul/2014:10:28:01] ENGINE Bus EXITED
这似乎像一个魅力工作。虽然由于某种原因,当我通过pip安装cherrypy时没有安装樱桃,所以我只是从Google Code repo中抓取它:)。 –