【问题标题】:python can not import tweepy librarypython无法导入tweepy库
【发布时间】:2017-10-28 22:55:00
【问题描述】:

我尝试导入 tweepy 库,但收到以下错误消息:

Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    import tweepy
ImportError: No module named 'tweepy'

在python文件中我得到这个消息,我不知道这两个消息是否相关

Python 3.5.0 (v3.5.0:374f501f4567, Sep 12 2015, 11:00:19) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable.
Visit http://www.python.org/download/mac/tcltk/ for current information.

【问题讨论】:

  • 错误提示您正在导入 tweedy,而不是 tweepy...
  • 实际上 safari 将其纠正为“tweedy”。但我导入 tweepy
  • 你安装了 tweepy 吗?试试pip install tweepy
  • 是的,我已经安装了
  • 您可能安装了多个版本的 python。你是如何开始 python 的,使用 python、python3 或其他东西?

标签: python tweepy


【解决方案1】:

您可能没有在正确的位置安装 tweepy。试试

pip3 install tweepy

我遇到了同样的问题,这为我保存了它。

【讨论】:

  • 我希望我能给你两个赞成票。我要疯了,直到我看到这个。然后,我意识到我的 spyder 运行的是 python 3.4 而不是 3.5,就像我想象的那样。我把所有东西都移到了 python 3.4 文件夹中,一切都到位了。很好的答案。
【解决方案2】:

试试

python -m pip install tweepy

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-07-29
    • 2015-10-04
    • 2013-03-24
    • 2012-08-11
    • 1970-01-01
    • 2016-05-02
    • 2020-11-07
    • 2016-09-18
    相关资源
    最近更新 更多