Alex Rivera | Logout

'Module object has no attribute 'get' Python error Requests?

Asked 2012-09-04T07:38:57.557
37

I just installed the Requests module by using easy_install and I tried to run the demo code of this tutorial,

import requests
payload = {'username': 'xxxx', 'password': 'xxxxx'}
r = requests.get('https://github.com/timeline.json')

but I get this error:

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

Edit
Report

1 Answer

4

You have to variants of how to fix this.

import requests

or

r = get('https://github.com/timeline.json')

P.S. First one is preferable

answered 2012-09-04T07:39:38.333

Your Answer