已安装Tweepy但无法导入iPython Notebook

时间:2016-01-26 03:16:56

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

我使用以下命令从命令行安装了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是否安装在错误的路径上?

1 个答案:

答案 0 :(得分:0)

似乎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版本,看看是否遇到相同的错误。