1

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'

2
  • 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 Commented Nov 27, 2018 at 17:02
  • 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) Commented Nov 27, 2018 at 17:07

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.