【问题标题】:ImportError: cannot import name cached_propertyImportError:无法导入名称 cached_property
【发布时间】:2012-03-14 22:56:18
【问题描述】:

我正在尝试在我参与的 Python/Google App Engine 项目上设置 Tipfy 扩展。我已按照运行 bootstrap.py 和 bin/buildout 的所有说明进行操作。一切似乎都奏效了,但现在当我尝试导入 tipfy.ext.auth 时,我收到了这个错误:

File "C:\{project}\app\lib\dist\tipfy\ext\auth\__init__.py", line 15, in <module>
    from tipfy import abort, cached_property, import_string, redirect
ImportError: cannot import name cached_property

我现在有点迷茫,甚至不知道在哪里寻找解决方案,诚然,我对 Python 和 GAE 都非常陌生。任何有关如何使此扩展工作的帮助或指导将不胜感激。

【问题讨论】:

  • 这里的潜在解决方案:tipfy.googlecode.com/hg/docs/source/guide/migrating.rst 删除该导入并改为从 werkzeug 导入。
  • @AdamBernier - 谢谢,效果很好!
  • 没问题。根据协议,我想我应该输入它作为答案。如果你愿意,你可以接受它,但不要觉得有义务这样做。
  • 我不确定您是否应该使用tipfy,除非它是必需的。现在没有人维护它。

标签: python google-app-engine tipfy


【解决方案1】:

这里的潜在解决方案:http://tipfy.googlecode.com/hg/docs/source/guide/migrating.rst
tl;dr:删除该导入并改为从 werkzeug 导入。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-03-31
    • 2014-10-10
    • 2014-09-20
    • 2014-08-28
    • 2014-06-10
    • 2016-05-16
    • 2019-05-25
    • 2017-04-22
    相关资源
    最近更新 更多