【问题标题】:Cannot import name 'GeoText' from the geotext Python package无法从地理文本 Python 包中导入名称“GeoText”
【发布时间】:2016-10-12 11:03:28
【问题描述】:

我已经从 pip 安装了 geotext 模块。

但是这一行:

from geotext import GeoText

产生这个错误:

ImportError: cannot import name 'GeoText'

模块结构如下: 其中没有子目录,而是直接包含 GeoText 类的 geotext python 文件: __init__.py 文件中也使用了正确的“from module import Class”语法。

from geotext import GeoText

谁能帮我解释为什么在似乎没有循环导入的情况下会产生错误?

【问题讨论】:

    标签: python import importerror geotext


    【解决方案1】:

    需要删除 init 文件中的导入语句。这更正了循环导入场景。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-13
      • 2022-10-15
      • 1970-01-01
      • 2019-02-17
      • 2023-04-08
      • 1970-01-01
      • 2020-09-04
      相关资源
      最近更新 更多