嗨,我一直在尝试为Jupyter Notebook安装twython。我通过python repl证明它在我的笔记本电脑中普遍安装。但它仍然不会出现在Jupyter笔记本上。寻找帮助试图弄清楚它是在我的Anaconda 3 Jupyter笔记本可以找到的地方。
背景:家庭作业任务试图挖掘推特上的推文
这是我收到的错误,我正在运行Mac OS
/Users/rachelmanca/twitter/__init__.py:22: UserWarning: The twython library has not been installed. Some functionality from the twitter package will not be available.
"The twython library has not been installed. "
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-4-38297a1141e0> in <module>
----> 1 import twitter
2 import twython
3 #---------------------------------------------
4 # Define a Function to Login Twitter API
5 def oauth_login():
~/twitter/__init__.py in <module>
34
35
---> 36 from nltk.twitter.common import json2csv
ModuleNotFoundError: No module named 'nltk.twitter
你安装了nltk包吗?
如果没有,那就去做:
pip3 install -U nltk
python3
import nltk
nltk.download()