Python ImportError:无法导入名称cpg

Python ImportError:无法导入名称cpg,python,python-2.7,cherrypy,Python,Python 2.7,Cherrypy,我在http://www.ibm.com/developerworks/opensource/library/os-cherrypy/?ca=dgr-lnxw01CherryPy #!/usr/bin/env python import cherrypy from cherrypy import cpg class Application: @cpg.expose def hello(self, what='Hello', who='world'): retur

我在
http://www.ibm.com/developerworks/opensource/library/os-cherrypy/?ca=dgr-lnxw01CherryPy

#!/usr/bin/env python
import cherrypy
from cherrypy import cpg

class Application:
    @cpg.expose
    def hello(self, what='Hello', who='world'):
        return '%s, %s!' % (what, who)
cpg.root = Application()
cpg.server.start()
但是我认为这个网站很旧,我有python的版本是2.7.3

错误是

Traceback (most recent call last):
File "hello4.py", line 3, in <module>
from cherrypy import cpg
ImportError: cannot import name cpg
回溯(最近一次呼叫最后一次):
文件“hello4.py”,第3行,在
来自cherrypy进口cpg
ImportError:无法导入名称cpg
用于安装程序的cherrypy
http://sourceforge.net/apps/trac/xenwebmanager/wiki/GettingStarted

新版本的python发生了什么变化


如何更改以使用Python2.7.3项目

。您需要找到一些比2005年更新的文档。

如何更改python 2.7.3?@MirkoCianfarani python版本并不重要。至于所需的更改,您是否尝试阅读了我链接中的升级指南?@MirkoCianfarani真的吗?然后