Ayush Kalani
Ayush Kalani

Reputation: 40

ImportError while running python program

I have tried all the import methods and upgrading the libraries but still I'm unable to get over this error. I have downloaded and installed all the nltk and corpus data programmatically and it is working in the python shell but i'm getting error.

    Traceback (most recent call last):
  File "spark.py", line 7, in <module>
    from textblob_aptagger import PerceptronTagger
  File "/usr/local/lib/python2.7/dist-packages/textblob_aptagger/__init__.py", line 8, in <module>
    from textblob_aptagger.taggers import PerceptronTagger
  File "/usr/local/lib/python2.7/dist-packages/textblob_aptagger/taggers.py", line 10, in <module>
    from textblob.packages import nltk
ImportError: No module named packages

Here's a pastebin to my code and imports..

Upvotes: 1

Views: 443

Answers (1)

Deusdeorum
Deusdeorum

Reputation: 1426

Same error has been posted on github here. Use this instead to install textblob:

$ pip install -U git+https://github.com/sloria/textblob-aptagger.git@dev

Also, you should change from text.blob import TextBlob as tbto from textblob...

Works for me..

Upvotes: 1

Related Questions