1
votes

I am trying to use Tweepy to stream Tweets from a developer API. I want to convert this into an SQLite database file.

However, I am getting an unusual error that links to the Tweepy libraries on my computer. I am using Python 3.6.7 (if that might have something to do with it).

Please let me know if you require more information.

In Windows 10 command line:

Exception in thread Thread-1: Traceback (most recent call last): File "C:\Users\CONFIDENTIAL\AppData\Local\Programs\Python\Python36\lib\threading.py", line 916, in _bootstrap_inner self.run() File "C:\Users\CONFIDENTIAL\AppData\Local\Programs\Python\Python36\lib\threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "C:\Users\CONFIDENTIAL\AppData\Local\Programs\Python\Python36\lib\site-packages\tweepy\streaming.py", line 293, in _run self.listener.on_exception(exception) AttributeError: 'int' object has no attribute 'on_exception'

1
Would it be possible to get the snippet of code causing the error. Otherwise, this is just a generic error. It is just saying that whatever you are passing in is an int; therefore, it obviously does not have the attrribute on_exception - The Pineapple
Unfortunately, I do not know what part of my code is causing the error as it isn't specified in the command line. It seems to be focusing on the .py files in the Python and Tweepy libraries. However, I noticed I get no result or error after I remove this code stream.filter(track=['keyword'], async=True) - AelaHuntress

1 Answers

0
votes

When initializing tweepy.Stream, you're passing an integer for the listener parameter, rather than an instance of tweepy.StreamListener. See the Streaming with Tweepy section of Tweepy's documentation.