【问题标题】:python2.7: Could not import get_url from bottlepython2.7:无法从瓶子导入 get_url
【发布时间】:2013-12-04 13:18:38
【问题描述】:

我无法从瓶子中导入get_url

from bottle import get_url

错误是:

Traceback (most recent call last):
  File "./py_test.py", line 4, in <module>
    from bottle import get_url
ImportError: cannot import name get_url

当我加载任何其他类似时没有错误:runpostgetrouteviewstatic_filetemplate,...

【问题讨论】:

  • 当你去@import bottle; bottle.get_url你真的可以调用这个函数吗?
  • 我不能:AttributeError: 'module' object has no attribute 'get_url'

标签: python import importerror bottle geturl


【解决方案1】:

Bottle 似乎没有公开get_url 函数。它确实有一个url function,它为默认应用程序包装了Bottle.get_url 方法。

【讨论】:

  • 感谢 Daniel,我已将每个文件中的所有 get_url 都更改为 url,并且效果很好!
猜你喜欢
  • 1970-01-01
  • 2012-03-21
  • 2018-11-27
  • 2020-11-17
  • 1970-01-01
  • 2021-04-18
  • 1970-01-01
  • 2017-03-06
  • 1970-01-01
相关资源
最近更新 更多