-1

I have installed the geotext module from pip.

However this line:

from geotext import GeoText

produces this error:

ImportError: cannot import name 'GeoText'

The module structure is as follows: geotext module contents where there is no sub directory but directly the geotext python file containing the GeoText class: GeoText class The correct syntax of "from module import Class" is used in the __init__.py file too.

from geotext import GeoText

Could anyone help me interpret as to why the error could be generated in such a scenario where there seems to be no circular imports?

Wolfgang Fahl
  • 15,016
  • 11
  • 93
  • 186
Anindita Bhowmik
  • 844
  • 1
  • 10
  • 18

2 Answers2

0

The import statement from the init file needs to be removed. This corrects the circular import scenario.

Anindita Bhowmik
  • 844
  • 1
  • 10
  • 18
0

I had the same problem.

Installing geotext like so fixed it for me:

python3 -m pip install geotext