IndigoResearch / textteaser

Official version of TextTeaser.
MIT License
621 stars 144 forks source link

ImportError: cannot import name 'TextTeaser' #13

Open yuquanle opened 6 years ago

yuquanle commented 6 years ago

I use :pip install textteaser in window. The install is success. when i run the demo code. I have encounter the error as follow: ImportError: cannot import name 'TextTeaser'

best wish yuquanle

rayrrr commented 5 years ago

TextTeaser is not a typical "PyPi" style Python package...you need to import it from its local path.

LIU-Yinyi commented 4 years ago

This error was caused by the conflict of importing directories. I found a possible solution:

  1. Edit the file site-packages/textteaser/__init__.py, replace from textteaser import TextTeaser with from textteaser.textteaser import TextTeaser.
  2. Edit the file site-packages/textteaser/textteaser.py, replace from . import exceptions with import exceptions, also replace from . import urls with import urls.

It works for me. Hope it helps. (btw I could not find where to access the apiKey properly)