AttributeError: 'module' object has no attribute 'Consumer'
See original GitHub issueI tried to use oauth library for my application, that will parse tweets from an account, used instructions from here https://dev.twitter.com/oauth/overview/single-user:
def oauth_req(url, key, secret, http_method="GET", post_body=None, http_headers=None):
consumer = oauth.Consumer(key=key, secret=secret)
token = oauth.Token(key=key, secret=secret)
client = oauth.Client(consumer, token)
resp, content = client.request( url, method=http_method, body=post_body, headers=http_headers, force_auth_header=True )
return content
def get_tweets():
timeline = oauth_req('https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=climagic', '3WTohSoXhJrmmk61oOwmJBwQp', 'FlqER9N3qoYl89bPTZ8EP9CWXBtttkikaYeE9pqIyCwX7GSNYA' )
print(timeline)
But it doesn’t work because of absence of attribute ‘Consumer’.
Issue Analytics
- State:
- Created 9 years ago
- Comments:11 (1 by maintainers)
Top Results From Across the Web
How should I use Consumer object in oauth2 v.2 in Python 3.4?
There is some problem with default installation of oauth2 using pip install oauth2 . Right now I tried it on both Python 2.7...
Read more >OAuth2 + Twitter 'module' object has no attribute 'Consumer ...
AttributeError : 'module' object has no attribute 'Consumer' I've tried including the oauth2 module in web2py/sites-package and myapp/modules and still get ...
Read more >AttributeError: 'module' object has no attribute 'Consumer' - Trac
How to Reproduce. While doing a POST operation on /admin/spamfilter/external , Trac issued an internal error. I added public / private keys for...
Read more >SALT AttributeError: 'module' object has no attribute 'dockermod'
The error is due to AttributeError: 'module' object that has no attribute 'dockermod'. This is due to a known and fixed regression in...
Read more >Attributeerror: 'Module' Object Has No Attribute ... - ADocLib
Module isn't properly installed. Check your sitepackages folder for the module. Not running with an appropriate version of Python i.e. installing modules meant....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

pip install oauth2solved the problem for me.i’ve downloaded it and replaced it, but it says ModuleNotFoundError: No module named ‘oauth2._compat’