I have installed the Python Twitter Library of Sixohsix () and tried to connect to Twitter, but this is not work Does. This is my code: I get an error message: I do not know why this error occurs even I Tried But this does not work either. I get some posts on stack overflow, but Not all solutions work. With your traceback, I see that your file name is For this reason, Twitter is attempting to import the contents of the line Rename your script to the name of the library that you are trying to use (like
traceback (most recent call end): File "./twitter.py", line 3, & lt; Module & gt; From twitter import * file to "/home/XXX/twitter.py", line 11, in & lt; Module & gt; T = Twitter (auth = OAuth (OAUTH_TOKEN, OAUTH_TOKEN, CONSUMER_KEY, CONSUMER_SECRET)) Name: ERROR: The name 'Twitter' is not defined
t = twitter.Twitter (...)
twitter.py Is:
in the file "/home/XXX/twitter.py", line 11, in & lt; Module & gt;
from the script by itself, rather than the
library called twitter < / Code>, because the current directory is generally preferred over shared libraries.
my_twitter Py ), and things will work.
No comments:
Post a Comment