twython icon indicating copy to clipboard operation
twython copied to clipboard

'Twython' from partially initialized module 'twython' (most likely due to a circular import)

Open NilSagor opened this issue 5 years ago • 2 comments

python 3.8.2 twython 3.8.2

ImportError: cannot import name 'Twython' from partially initialized module 'twython' (most likely due to a circular import)

import sys import string from twython import Twython

twitter = Twython('Insert Consumer Key Here', 'Insert Consumer Secret Key',oauth_version=2) Access_token = twitter.obtain_access_token() t = Twython('Insert Consumer Key', access_token=Access_token)

user_timeline = t.search(q='@puremichigan', count=20, include_rts=1)

for tweets in user_timeline['statuses']: print(tweets['text'] +"\n")

NilSagor avatar Jul 11 '20 03:07 NilSagor

Same .. Wondering how to solve.

gangaasoonu avatar Dec 02 '23 14:12 gangaasoonu

Found the solution:

python file/script name was same as the Library viz., twython.py

Python Interpreter got confused.

renaming the python script name to something else (viz., call_twython.py) solved this Issue.

gangaasoonu avatar Dec 02 '23 18:12 gangaasoonu