gpt4 book ai didi

python-3.x - CherryPy 在 Windows 上运行 tut01 文件

转载 作者:行者123 更新时间:2023-12-02 00:15:00 24 4
gpt4 key购买 nike

一些信息:Python 3.2.3,樱桃版本 3.2.2。 Windows 7 64 位。

安装 Cherrypy,使用正确的 Python 目录设置 PATH 等。但是,每当我运行教程文件(tut01,Hello world)或任何其他具有相同代码的 python 文件时,我都会得到以下输出:

F:\Code>python helloworld.py [29/Nov/2012:22:37:22] ENGINE Listening for SIGTERM. [29/Nov/2012:22:37:22] ENGINE Bus STARTING CherryPy Checker: The Application mounted at '' has an empty config.

[29/Nov/2012:22:37:22] ENGINE Started monitor thread '_TimeoutMonitor'. [29/Nov/2012:22:37:22] ENGINE Started monitor thread 'Autoreloader'. [29/Nov/2012:22:37:22] ENGINE Error in 'start' listener > Traceback (most recent call last): File "C:\Python32\lib\site-packages\cherrypy\process\wspbus.py", line 197, in publish output.append(listener(*args, **kwargs)) File "C:\Python32\lib\site-packages\cherrypy_cpserver.py", line 150, in start

self.httpserver, self.bind_addr = self.httpserver_from_self()   File "C:\Python32\lib\site-packages\cherrypy\_cpserver.py", line 140,

in https erver_from_self from cherrypy import _cpwsgi_server File "C:\Python32\lib\site-packages\cherrypy_cpwsgi_server.py", line 7, in from cherrypy import wsgiserver File "C:\Python32\lib\site-packages\cherrypy\wsgiserver__init__.py", line 14, in exec('from .wsgiserver3 import *') File "", line 1, in ImportError: No module named wsgiserver3

[29/Nov/2012:22:37:22] ENGINE Shutting down due to error in start listener: Traceback (most recent call last): File "C:\Python32\lib\site-packages\cherrypy\process\wspbus.py", line 235, in start self.publish('start') File "C:\Python32\lib\site-packages\cherrypy\process\wspbus.py", line 215, in publish raise exc cherrypy.process.wspbus.ChannelFailures: ImportError('No module named wsgiserver 3',)

[29/Nov/2012:22:37:22] ENGINE Bus STOPPING [29/Nov/2012:22:37:22] ENGINE HTTP Server None already shut down [29/Nov/2012:22:37:22] ENGINE Stopped thread 'Autoreloader'. [29/Nov/2012:22:37:22] ENGINE Stopped thread '_TimeoutMonitor'. [29/Nov/2012:22:37:22] ENGINE Bus STOPPED [29/Nov/2012:22:37:22] ENGINE Bus EXITING [29/Nov/2012:22:37:22] ENGINE Bus EXITED

当它应该显示 Hello World 时,将浏览器指向 localhost:8080 什么也不做。

很确定我根据 Cherrypy 网站上的安装指南正确地完成了所有操作。不完全确定如何修复它,但我猜它与导入错误有关。有没有其他人在 Windows 上为 python3 安装 cherrypy 成功?

找到解决方案:https://bitbucket.org/cherrypy/cherrypy/issue/1110/cherrypy-322win32exe-installer-didnt

原始安装程序缺少 wsgiserver3 模块,这是它在 Python 3.x 上工作所必需的。上面的安装程序应该可以解决这个问题。

最佳答案

我为此苦苦挣扎,有一个简单的解决方案:

  1. 将存储库克隆到您的本地计算机。
  2. 导航到根文件夹并执行以下命令:python setup.py install

它在 README.txt 中提到 here in the official source repo .

关于python-3.x - CherryPy 在 Windows 上运行 tut01 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13638796/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com