【问题标题】:Installed Tweepy but unable to import into iPython Notebook安装了 Tweepy 但无法导入 iPython Notebook
【发布时间】:2016-05-02 14:00:34
【问题描述】:

我从命令行安装了 Tweepy 3.5.0:

easy install tweepy

后来:

pip install tweepy

卸载后。

并成功安装在C:\python27\lib\site-packages


我在 iPython Notebook 中使用 Python 2.7.1。当我跑步时:

import python

我收到以下错误:

No module named tweepy 

Tweepy 是否安装在错误的路径中?

【问题讨论】:

  • 你不想导入tweepy(不是导入python)吗?而且,您特别提到了 ipython 笔记本。与命令行相比,您在 ipython notebook 中得到的结果是否不同?
  • 这里,我勾画出你看到的问题:pythonipythonstackoverflow.com/questions/32680081/…是一样的,关键是要找出ipython属于哪个解释器,并准确安装tweepy给那个口译员。

标签: python python-2.7 twitter ipython-notebook tweepy


【解决方案1】:

pip 似乎没有正确安装,因此请按照以下步骤进行并分享反馈。

C:\>pip install tweepy

只要 pip 已经添加到系统的 Path 环境变量中,第一个命令就足够了。要检查它,请执行以下操作:

    Open Command Prompt (DOS prompt).
    Type python and press enter.
    Once python prompt (>>>) appears, type import pip and press enter.

如果您看到错误,则 pip 尚未添加到环境变量 Path。如果没有任何错误,则 pip 已正确安装。

在这种情况下,请重新安装 Python 一次,然后重试。我正在使用 Python 3.5,tweepy 对我来说很好用。我看到您使用的是 Python 2.7.1 版本。我希望 Python 已正确安装。如果需要,请尝试卸载 Python,然后重新正确安装以确保。我还建议您尝试使用 Python 3.x 版本一次,看看是否会遇到相同的错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多