'Python Tweepy 4.4 streamlistener attribute not found?
I'm trying to listen for a certain character in a tweet from a specific twitter account.
I get a compile time error.
Here's the relevant pieces of the code:
import tweepy
class MyStreamListener(tweepy.streaming.StreamListener):
def on_status(self, status):
print(status.text)
def main():
api = twitter_authentication() #this function does the necessary twitter auth
myStreamListener = MyStreamListener()
myStream = tweepy.streaming.Stream(auth=api.auth, listener=myStreamListener)
myStream.filter(track=["test"], follow=["123456"])
When I run this in pycharm, I get the following error:
line 68, in <module>
class MyStreamListener(tweepy.streaming.StreamListener):
AttributeError: module 'tweepy.streaming' has no attribute 'StreamListener'
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
