0

I am trying to use Yelp's API using oauth2 package (version 2), the Python 3.4 (in Anaconda's Spyder) code is like:

consumer = oauth2.Consumer(CONSUMER_KEY, CONSUMER_SECRET)

and I get this error message:

AttributeError: 'module' object has no attribute 'Consumer'

I'm guessing Consumer doesn't exist in this version of oauth2! Any help would be appreciated,

Asteroid
  • 1,049
  • 2
  • 8
  • 16
  • I had the same issue, you can install python 2.7 on the same anaconda using this link http://stackoverflow.com/questions/24405561/how-to-install-2-anacondas-python-2-7-and-3-4-on-mac-os-10-9 – emarshah Aug 07 '15 at 12:44

1 Answers1

1

There is some problem with default installation of oauth2 using pip install oauth2. Right now I tried it on both Python 2.7 and Python 3.4 on Anaconda, its not working. You can copy the code ( _ _ init _ _.py) from here into your _ _ init _ _.py file and restart your kernel.

Location of your _ _ init _ _ .py file can be found via

import oauth2 as oauth
print(oauth)

After restart, kernel may ask for libraries which can be found via pip search <library_name> and then doing the pip install <library_name>

emarshah
  • 328
  • 3
  • 14