Tweepy 错误 - 'Unexpected parameter: status'

Tweepy error - 'Unexpected parameter: status'

我正在使用 Tweepy post 带有文本的图像,但文本 (status) 片段出现错误 -

Unexpected parameter: status

我确定我使用的方法是正确的; status 对 post 的文本正文有效。这是我的代码 -

post =  api.media_upload("/Users/me/p1/images/" + img_file, status=fileName[:-6])

不仅我收到了这个奇怪的错误,而且没有 post 对 Twitter 进行处理,无论是图像还是文本。

如果我使用 post = api.update_status(fileName[:-6]) 到 post 只是文本,它工作正常。 我检查了 Tweepy 文档,但看不到我的代码或我对 status.. 的使用有问题。 任何帮助表示赞赏。

正如警告所说,API.media_upload 不需要 status 参数。
它不是 API.update_status_with_media.
的等效替代品 根据 Tweepy 的文档,API.media_upload returns a media object.
您需要使用此媒体对象的 ID 并在创建推文时传递它,例如API.update_status.
有关详细信息,请参阅 Twitter API documentation on uploading media.