You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Tweepy创建推文触发AttributeError: _make_request问题求助

Problem Description

I'm trying to build a tweet bot with Tweepy but keep getting errors. I'm working with Python 3 and Twitter API v2, and authentication works fine when I run api.verify_credentials on its own.

Update

I've got the following code running successfully:

import tweepy

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

filename=open('content.txt.txt')

f=filename.readlines()

filename.close()

for line in f:
 try:
  client.create_tweet(text=line)
  print(line)
 except tweepy.errors.TweepyException as err:
   print("err")
   
print("יא גאון מחשבים")

Content sourced from Stack Exchange, asked by Toma Schreibman

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.15 02:30:56