Turbogears 2.0 与 Python 2.6
我尝试在 Windows 7 和 Windows XP 上安装带有 Python 2.6 的 TurboGears 2.0,但两者都给出相同的错误:
File "D:\PythonProjects\tg2env\Scripts\paster-script.py", line 8, in <module>
load_entry_point('pastescript==1.7.3', 'console_scripts', 'paster')()
File "D:\PythonProjects\tg2env\lib\site-packages\pastescript-1.7.3-py2.6.egg\paste\script\command.py", line 73, in run
commands = get_commands()
File "D:\PythonProjects\tg2env\lib\site-packages\pastescript-1.7.3-py2.6.egg\paste\script\command.py", line 115, in get_
plugins = pluginlib.resolve_plugins(plugins)
File "D:\PythonProjects\tg2env\lib\site-packages\pastescript-1.7.3-py2.6.egg\paste\script\pluginlib.py", line 81, in res
pkg_resources.require(plugin)
File "D:\PythonProjects\tg2env\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.py", line 626, in require
File "D:\PythonProjects\tg2env\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.py", line 524, in resolve
pkg_resources.DistributionNotFound: zope.sqlalchemy>=0.4: Not Found for: City_Guide (did you run python setup.py develop?)
现在,根据主站点上的文档,TurboGears 2.0 支持 Python 2.6 in 此页面:
TurboGears 适用于 2.4 到 2.6 之间的任何版本的 python。在撰写本文时,部署最广泛的 Python 版本是 2.5 版。 python 2.4 和 python 2.6 都需要额外的步骤,这些步骤将在相应的部分中介绍。
但他们从未在文档中提及这些步骤。
I've tried to install TurboGears 2.0 with Python 2.6 on both Windows 7 and Windows XP, but both give the same error:
File "D:\PythonProjects\tg2env\Scripts\paster-script.py", line 8, in <module>
load_entry_point('pastescript==1.7.3', 'console_scripts', 'paster')()
File "D:\PythonProjects\tg2env\lib\site-packages\pastescript-1.7.3-py2.6.egg\paste\script\command.py", line 73, in run
commands = get_commands()
File "D:\PythonProjects\tg2env\lib\site-packages\pastescript-1.7.3-py2.6.egg\paste\script\command.py", line 115, in get_
plugins = pluginlib.resolve_plugins(plugins)
File "D:\PythonProjects\tg2env\lib\site-packages\pastescript-1.7.3-py2.6.egg\paste\script\pluginlib.py", line 81, in res
pkg_resources.require(plugin)
File "D:\PythonProjects\tg2env\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.py", line 626, in require
File "D:\PythonProjects\tg2env\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.py", line 524, in resolve
pkg_resources.DistributionNotFound: zope.sqlalchemy>=0.4: Not Found for: City_Guide (did you run python setup.py develop?)
Now, according to the documentation on the main site, TurboGears 2.0 supports Python 2.6 in this page:
TurboGears works with any version of python between 2.4 and 2.6. The most widely deployed version of python at the moment of this writing is version 2.5. Both python 2.4 and python 2.6 require additional steps which will be covered in the appropriate sections.
But they never mention those steps in the documentation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你运行了 python setup.pydevelopment 吗? (如错误消息所示)
好吧,这就是你的问题的原因。我想知道你的评论“但是开发命令安装...”你的网络应用程序的开发命令不应该安装任何东西。它只是为了设置数据库。
您是否在网络应用程序的目录内部运行此命令?
did you run python setup.py develop? (as the error message says)
Okay, that is the cause of your problems. I'm wondering about your comment "but the develop command installs..." The develop command of your web app shouldn't install anything. It's just meant to set up the database.
Are you running this command inside the directory of your web app?
我也有同样的问题。我终于能够让它发挥作用了。我关闭了命令窗口。我打开了一个新的命令窗口,并通过执行适当的 activate.bat 激活了 virtualenv。之后我重新执行了“setup.pydevelopment”,最后我能够启动粘贴服务,如 Turbogears wiki 中记录的那样。
I had the same problem. I was finally able to get it to work. I closed the command window. i opened a new commandwindow and activated the virtualenv by executing the appropriate activate.bat. Afterwards I reexecuted "setup.py develop" and finally i was able to start paster serve as documented in the Turbogears wiki.
关键是运行pythonsetup.pydevelopment.ini。如果你只运行setup.pydevelopment.ini,它将使用已安装的python,并且不会乱扔到你的virtualenv中
The key is to run python setup.py development.ini. If you just run setup.py development.ini, it will use the installed python, and will not litter to your virtualenv