turbogears2 快速入门示例问题

1 投票
1 回答
1320 浏览
提问于 2025-04-16 10:41

你好!

我安装了Ubuntu 10.10系统,想试试Turbogear这个工具。我觉得我按照安装步骤做得还不错。不过,在创建quickstart example的过程中遇到了一些问题。

当我输入命令来创建quickstart示例时,我选择了默认值,也就是输入了example、no和yes来创建这个示例。在最后一步,我输入了paster setup-app development.inipaster serve development.ini,结果出现了一个错误,提示没有找到名为template.Genshi的模块。我不太明白这是什么意思,而且在网上也找不到解决这个问题的答案。难道是因为Ubuntu自带的是Python 2.6.6的版本?

这些是我按照< a href="http://www.turbogears.org/2.1/docs/main/DownloadInstall.html" rel="nofollow">这里的步骤进行的。

$ virtualenv --no-site-packages -p python2.6 tg2env
$ cd tg2env/
$ source bin/activate
(tg2env)$ easy_install -i http://www.turbogears.org/2.1/downloads/current/index tg.devtools
(tg2env)$ paster quickstart example
(tg2env)$ cd example/
(tg2env)$ python setup.py develop
(tg2env)$ nosetests
(tg2env)$ paster setup-app development.ini
(tg2env)$ paster serve development.ini
(tg2env)$ deactivate

这是我在运行paster setup-app development.ini时遇到的错误。

File "/home/starcorn/tg2env/bin/paster", line 9, in <module>
    load_entry_point('PasteScript==1.7.3', 'console_scripts', 'paster')()
  File "/home/starcorn/tg2env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 84, in run
    invoke(command, command_name, options, args[1:])
  File "/home/starcorn/tg2env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 123, in invoke
    exit_code = runner.run(args)
  File "/home/starcorn/tg2env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/appinstall.py", line 68, in run
    return super(AbstractInstallCommand, self).run(new_args)
  File "/home/starcorn/tg2env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 218, in run
    result = self.command()
  File "/home/starcorn/tg2env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/appinstall.py", line 456, in command
    self, config_file, section, self.sysconfig_install_vars(installer))
  File "/home/starcorn/tg2env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/appinstall.py", line 598, in setup_config
    mod.setup_app, command, filename, section, vars)
  File "/home/starcorn/tg2env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/appinstall.py", line 612, in _call_setup_app
    func(command, conf, vars)
  File "/home/starcorn/tg2env/example/example/websetup/__init__.py", line 17, in setup_app
    load_environment(conf.global_conf, conf.local_conf)
  File "/home/starcorn/tg2env/lib/python2.6/site-packages/TurboGears2-2.1-py2.6.egg/tg/configuration.py", line 581, in load_environment
    setup()
  File "/home/starcorn/tg2env/lib/python2.6/site-packages/TurboGears2-2.1-py2.6.egg/tg/configuration.py", line 392, in setup_genshi_renderer
    from tg.dottednames.genshi_lookup import GenshiTemplateLoader
  File "/home/starcorn/tg2env/lib/python2.6/site-packages/TurboGears2-2.1-py2.6.egg/tg/dottednames/genshi_lookup.py", line 6, in <module>
    from genshi.template import TemplateLoader
ImportError: No module named genshi.template

1 个回答

3

至于为什么没有安装,这是turbogears的问题,不过...

$ easy_install Genshi

这个会解决这个问题。

撰写回答