beth
beth

Reputation: 435

ImportError: No module named textblob

I am using Atom and just getting started with Python. When I try to run this code:

from textblob import TextBlob
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer

analysis = TextBlob("TextBlob sure looks like it has some interesting 
features")

print(analysis.tags)

I get this:

Traceback (most recent call last):
File "/Users/bethwalsh/Documents/GitHub/automated-personas/py/test_001.py", 
line 1, in <module>
from textblob import TextBlob
ImportError: No module named textblob

I have tried to install textblob but still no change:

$ pip3 install textblob
Requirement already satisfied: textblob in 
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages 
(0.15.1)

Any ideas?

Upvotes: 1

Views: 12094

Answers (1)

beth
beth

Reputation: 435

Yes, that worked thank you!

Had to install the package atom-runner and in the code change python -> python3.

Also ran

which python3

and added the path to the top of my py file:

#!/Library/Frameworks/Python.framework/Versions/3.6/bin/python

Upvotes: 0

Related Questions