Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'module' object has no attribute 'Api' #18

Open
engFelipeMonteiro opened this issue Jul 17, 2016 · 1 comment
Open

AttributeError: 'module' object has no attribute 'Api' #18

engFelipeMonteiro opened this issue Jul 17, 2016 · 1 comment

Comments

@engFelipeMonteiro
Copy link

Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "speedcomplainer.py", line 101, in run
self.tweetResults(speedTestResults)
File "speedcomplainer.py", line 138, in tweetResults
api = twitter.Api(consumer_key=self.config['twitter']['twitterConsumerKey'],
AttributeError: 'module' object has no attribute 'Api'

I suggest the substitution for the library twython as below:

from twython import Twython

TOKEN=self.config['twitter']['twitterTokenSecret']
CON_SEC_KEY=self.config['twitter']['twitterConsumerKey']
SEC=self.config['twitter']['twitterConsumerSecret']
KEY=self.config['twitter']['twitterToken']
api = Twython(CON_SEC_KEY, CON_SEC,TOKEN_KEY, TOKEN)

if api:

            api.update_status(status=message)
@ericzlmd
Copy link

ericzlmd commented Dec 1, 2016

Hi,

just want to ask where am I supposed to sub this code? I inserted mine at ln146 and the issue persists. I have added from twython import Twython and also commented out

if api:
status = api.PostUpdate(message)

Wondering if I've done the right thing. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants