I just wrote the following code to play around with the query library
requests tests import requests r = requests.get('https://api.github.com/events')
but I get the same error message even if I use from requests import *
Traceback (most recent call last): File "/Users/dvanderknaap/Desktop/Organized/CS/My_Python_Programs/requests.py", line 3, in <module> import requests File "/Users/dvanderknaap/Desktop/Organized/CS/My_Python_Programs/requests.py", line 5, in <module> r = requests.get('https://api.github.com/events') AttributeError: 'module' object has no attribute 'get'
I tried reinstalling the requests using pip install requests , but the output is:
Requirement already satisfied (use
I think the problem is that it is installed in my python3.5 library, but I am using python2.7, but I am not sure how to fix it. Advice?
source share