4

This morning I set out to install the TextBlob module found at https://textblob.readthedocs.org/en/latest/index.html

Per the installation documentation I first ran:

pip install -U textblob

Now if I run that command I get the following:

Requirement already up-to-date: textblob in /Library/Python/2.7/site-packages/textblob-0.5.0-py2.7.egg

Requirement already up-to-date: PyYAML in /Library/Python/2.7/site-packages (from textblob)

Cleaning up...

While it would appear to be installed, when I try to run a one line file (wherein the only line is from text.blob import TextBlob I am told ImportError: No module named blob

So then I tried to install from git, first I cloned the repository and then I ran both of the following snippets

sudo python setup.py install

and

sudo python2.7 setup.py install

Unfortunately neither one of those commands solved my issue. So now im stuck. I suppose the best course of action is to start over but im pretty much lost.

Peter Foti
  • 5,526
  • 6
  • 34
  • 47
  • 3
    You don't have any files named `text.py` or any folders named `text` in the current working directory, do you? – Blender Aug 11 '13 at 17:10
  • Wow, amazing the stuff you overlook when banging your head against the desk. I did in fact have a file named `text.py` in my `pwd` and upon removal I am now able to interact with this module. Thank you for your help Blender, if you submit it as an answer I can go ahead and accept it. – Peter Foti Aug 11 '13 at 17:14

2 Answers2

4

As Blender pointed out in his comments above, my problem was with a text.py file in the same directory that I was trying to run TextBlob. The deletion of this file led to the fixture of my issue.

Thank you Blender.

Peter Foti
  • 5,526
  • 6
  • 34
  • 47
  • 2
    I had a similar error. I named the file I was working in textblob.py. This also caused the error. Be sure to delete both the textblob.py and textblob.pyc compiled file! I forgot to delete the pyc file and the same error persisted. – cgnorthcutt Dec 07 '14 at 04:57
0

For anyone else, who may have this issue, I had another virtual environment open in my VS Code terminal (conda) that was not the same virtual environment I installed the textblob package in. Switched over and all was good.

cheznead
  • 2,589
  • 7
  • 29
  • 50