我正在使用Atom并刚刚开始使用Python。 当我尝试运行此代码时:
from textblob import TextBlob
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
analysis = TextBlob("TextBlob sure looks like it has some interesting
features")
print(analysis.tags)
我明白了:
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
我尝试安装textblob,但仍然没有更改:
$ pip3 install textblob
Requirement already satisfied: textblob in
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
(0.15.1)
有什么想法吗?
答案 0 :(得分:0)
是的,那很有效,谢谢!
必须安装软件包atom-runner ,并在代码中更改 python -> python3。
还跑了
which python3
并将路径添加到我的py文件的顶部:
#!/Library/Frameworks/Python.framework/Versions/3.6/bin/python