Tweepy 3.10.0,AttributeError:模块“tweepy”没有属性“Client”

The*_*Dan 2 python tweepy

我正在尝试将 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)

   
Run Code Online (Sandbox Code Playgroud)

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

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

我的错误是什么?

Har*_*758 5

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 (2认同)