【问题标题】:Tweepy 3.10.0, AttributeError: module 'tweepy' has no attribute 'Client'Tweepy 3.10.0,AttributeError:模块 'tweepy' 没有属性 'Client'
【发布时间】:2021-08-30 20:37:45
【问题描述】:

我正在尝试将 Twitter API 的第 2 版与 tweepy 3.10.0 一起使用,但在阅读文档时感到困惑,https://docs.tweepy.org/en/latest/client.html

当我尝试设置 API 时,如下例所示:

import tweepy

client = tweepy.Client(consumer_key=consumer_key, 
                                consumer_secret=consumer_secret,
                                access_token=access_token, 
                                access_token_secret=access_token_secret)

   

我收到此错误:AttributeError: module 'tweepy' has no attribute 'Client'

我之前使用过 Tweepy,它适用于我配置的一些测试,但我需要使用版本 2,因为我想执行此版本 API 的一些功能。

我的错误是什么?

【问题讨论】:

    标签: python tweepy


    【解决方案1】:

    Tweepy.Client 及其对 Twitter API v2 的支持仍在 master 分支上开发中。
    它尚未发布,也不是 v3.10.0 的一部分,但它会作为 v4.0 的一部分发布。

    https://docs.tweepy.org/en/latest/ 是文档的最新开发版本。
    有关 v3.10.0 的文档,请参阅 https://docs.tweepy.org/en/v3.10.0/

    【讨论】:

    • 是的,实际上解决方案正在更新到版本 4.0.0 alpha
    猜你喜欢
    • 2022-11-05
    • 2021-11-23
    • 2017-06-14
    • 2022-10-18
    • 2021-11-25
    • 1970-01-01
    • 2022-07-23
    • 1970-01-01
    • 2018-09-02
    相关资源
    最近更新 更多