【问题标题】:Jupyter Notebook can't find moduleJupyter Notebook 找不到模块
【发布时间】:2019-08-14 15:43:07
【问题描述】:

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

背景:家庭作业试图挖掘推特的推文

这是我收到的错误,我正在运行 Mac OS

/Users/name/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

【问题讨论】:

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


    【解决方案1】:

    你安装nltk包了吗?

    如果没有,请执行:

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

      import nltk nltk.download()

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-10-27
      • 1970-01-01
      • 1970-01-01
      • 2023-01-07
      • 2021-09-19
      相关资源
      最近更新 更多