Turbogears 2.0 与 Python 2.6

发布于 2024-08-06 13:25:21 字数 1432 浏览 9 评论 0原文

我尝试在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

且行且努力 2024-08-13 13:25:21

你运行了 python setup.pydevelopment 吗? (如错误消息所示)

我按照文档中的建议使用 virtualenv,但开发命令将包安装在原始 python 文件夹中。

好吧,这就是你的问题的原因。我想知道你的评论“但是开发命令安装...”你的网络应用程序的开发命令不应该安装任何东西。它只是为了设置数据库。

您是否在网络应用程序的目录内部运行此命令?

did you run python setup.py develop? (as the error message says)

I was using virtualenv as recommended in the documentation, but the develop command installs the packages in the original python folder.

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?

贪恋 2024-08-13 13:25:21

我也有同样的问题。我终于能够让它发挥作用了。我关闭了命令窗口。我打开了一个新的命令窗口,并通过执行适当的 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.

超可爱的懒熊 2024-08-13 13:25:21

关键是运行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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文