小编Nay*_*jer的帖子

Python 3.9 中的“AttributeError:模块‘tweepy’没有属性‘StreamListener’”

class MyStreamListener(tweepy.StreamListener):
    def on_status(self, status):
        print(status.text)  # prints every tweet received

    def on_error(self, status_code):
        if status_code == 420:  # end of monthly limit rate (500k)
            return False
Run Code Online (Sandbox Code Playgroud)

我使用 Python 3.9 并通过 pip 安装 Tweepy。我AttributeError在课堂上接到了电话。我的进口只是import tweepy. 身份验证得到正确处理。在streaming.py文件中,我有类Stream. 但使用这个类就到此为止了。例如status.text,即使有该on_status功能,也没有。我有点困惑。

python twitter attributes tweepy

7
推荐指数
2
解决办法
1万
查看次数

标签 统计

attributes ×1

python ×1

tweepy ×1

twitter ×1