sloria / textblob-aptagger

*Deprecated* A fast and accurate part-of-speech tagger for TextBlob.
MIT License
104 stars 41 forks source link

ImportError: No module named packages? #6

Closed awhillas closed 9 years ago

awhillas commented 9 years ago
Python 2.7.7 (default, Jun 18 2014, 12:20:07) 
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from textblob import TextBlob
>>> from textblob_aptagger import PerceptronTagger
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/textblob_aptagger/__init__.py", line 8, in <module>
    from textblob_aptagger.taggers import PerceptronTagger
  File "/usr/local/lib/python2.7/site-packages/textblob_aptagger/taggers.py", line 10, in <module>
    from textblob.packages import nltk
ImportError: No module named packages
>>> 
awhillas commented 9 years ago

yes i have NLTK installed :-?

sloria commented 9 years ago

@awhillas Looks like you have an older version of TextBlob, which had a vendorized version of NLTK. textblob-aptagger depends on TextBlob>=0.9.0. You can upgrade with

pip install -U textblob
ffjiang commented 9 years ago

I have the exact same problem and I have TextBlob version 0.9.1.

Edit: Fixed it by just changing the line from "from textblob.packages import nltk" to "import nltk"