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 'oauth' has no attribute 'OAuthConsumer #152

Closed
Peter7Hess opened this issue Jan 18, 2018 · 3 comments
Closed

AttributeError: module 'oauth' has no attribute 'OAuthConsumer #152

Peter7Hess opened this issue Jan 18, 2018 · 3 comments

Comments

@Peter7Hess
Copy link

Upon running sample code twitter1.py and it fails on this error:

$ python3 twitter1.py

Enter Twitter Account:mytwitter
Traceback (most recent call last):
File "twitter1.py", line 20, in
{'screen_name': acct, 'count': '2'})
File "/Users/xxxxph/PycharmProjects/xxxxPy/twurl.py", line 10, in augment
consumer = oauth.OAuthConsumer(secrets['consumer_key'],secrets['consumer_secret'])
AttributeError: module 'oauth' has no attribute 'OAuthConsumer

any suggestions, the same error occurs if I try with oauth2

@Peter7Hess Peter7Hess changed the title Peters-MBP:HessPy hessph$ python3 twitter1.py Enter Twitter Account:peterhess Traceback (most recent call last): File "twitter1.py", line 20, in <module> {'screen_name': acct, 'count': '2'}) File "/Users/hessph/PycharmProjects/HessPy/twurl.py", line 10, in augment consumer = oauth.OAuthConsumer(secrets['consumer_key'],secrets['consumer_secret']) AttributeError: module 'oauth' has no attribute 'OAuthConsumer AttributeError: module 'oauth' has no attribute 'OAuthConsumer Jan 18, 2018
@srcatto
Copy link
Contributor

srcatto commented Jun 8, 2018

This uses the oauth.py downloaded from the code3 folder, https://py4e.com/code3/ it's possibly PyCharm has a different version, or it's common for people to install OAuth (consider the only installs in the course are an editor/Python) , while OAuth2 is different in any case.

Downloaded all the files into a new folder, a hidden.py from 2015 and it's working fine.

@BordenCT
Copy link

BordenCT commented Oct 5, 2022

For future people who stumble across this issue:
The oauth library has been updated and requires to instead of
import oauth
we must
from oauth import oauth

@csev
Copy link
Owner

csev commented Jan 3, 2024

The entire Twitter code is no longer part of this course. They broke it all so bad that it is no longer mentioned in the book - Chapter 15 is completely rewritten - https://do1.dr-chuck.com/pythonlearn/EN_us/pythonlearn.pdf

Thanks.

@csev csev closed this as completed Jan 3, 2024
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

4 participants