代码之家  ›  专栏  ›  技术社区  ›  Sea Eff

Tweepy 4.14.0 Tweepy网站的示例脚本给出AttributeError:模块“Tweepy”没有属性“Client”

  •  0
  • Sea Eff  · 技术社区  · 2 年前

    我真的只是想从网站上做这个例子。我在下面的脚本中有我的相关密钥,忽略

    脚本如下

    import tweepy
    
    client = tweepy.Client(consumer_key='REPLACE_ME',
                           consumer_secret='REPLACE_ME',
                           access_token='REPLACE_ME',
                           access_token_secret='REPLACE_ME')
    
    # Replace the text with whatever you want to Tweet about
    response = client.create_tweet(text='hello world')
    
    print(response)
    

    我得到的错误是:

    AttributeError: module 'tweepy' has no attribute 'Client'
    

    我不知道为什么这样不起作用。我没有其他名为tweepy等的文件。

    有其他人遇到过这个问题吗?

    我已经重新安装了花呢,我已经强制升级了它,我不知道还有什么原因导致了这种情况。我真的很困惑。

    0 回复  |  直到 2 年前