Jupyter Notebook找不到模块

时间:2019-03-24 02:22:14

标签: python-3.x twitter jupyter-notebook anaconda twython

嗨,我一直在尝试为Jupyter Notebook安装twython。我已经通过python repl证明,它已在笔记本电脑中普遍安装。但是它仍然不会出现在Jupyter Notebook上。在我的Anaconda 3 Jupyter Notebook可以找到的地方找到了试图找出问题的帮助。

上下文:作业分配试图挖掘Twitter的推文

这是我收到的错误,我正在运行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

1 个答案:

答案 0 :(得分:0)

您已经安装了nltk软件包吗?

否则,请执行以下操作:

  1. pip3 install -U nltk
  2. 然后运行python3
  3. 在python3命令行中运行:

    import nltk nltk.download()

  4. 下载后,重新启动jupyter,然后再次运行您的代码。