gpt4 book ai didi

python - webhelpers 有一些严重错误

转载 作者:太空宇宙 更新时间:2023-11-03 19:09:28 25 4
gpt4 key购买 nike

在我的 virtualenv 中,我安装了 WebHelpers,但出现了一些错误,但安装过程最终完成了。

当我启动 Pyramid Web 应用程序时,我仍然收到此错误:

  File "D:\Py3Env\lib\site-packages\webhelpers-1.3-py3.2.egg\webhelpers\paginate
.py", line 250
raise Exception, "__getitem__ without slicing not supported"
SyntaxError: invalid syntax

最佳答案

WebHelpers 包(尚)不兼容 python 3。

Python 3 取消了对引发类型和值异常的支持。它应该改为:

raise Exception("__getitem__ without slicing not supported")

不幸的是,WebHelpers 源代码中的更多内容使得将其移植到 Python 3 成为一项艰巨的任务,特别是对于 Python 新手来说。

您要么必须切换到使用 Python 2,要么完全使用不同的库。

关于python - webhelpers 有一些严重错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13505081/

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