Reputation: 101
I would like to use module 'requests', however, after installation, even importing does not work properly:
Python 2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "requests.py", line 20, in <module>
r = requests.post(url, data=json.dumps(payload), headers=headers)
AttributeError: 'module' object has no attribute 'post'
Any clue?
Upvotes: 0
Views: 256
Reputation: 101
Ok, I realized the problem was that my actual filename was requests.py too :D Hope it helps somebody.
Upvotes: 1