Python 2.7.3 (default, Feb 27 2014, 19:58:35)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> req = requests.request('GET', 'http://httpbin.org/get')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/symbol/python2.7.3/local/lib/python2.7/site-packages/requests/api.py", line 48, in request
session = sessions.Session()
File "/home/symbol/python2.7.3/local/lib/python2.7/site-packages/requests/sessions.py", line 284, in __init__
self.headers = default_headers()
File "/home/symbol/python2.7.3/local/lib/python2.7/site-packages/requests/utils.py", line 552, in default_headers
'User-Agent': default_user_agent(),
File "/home/symbol/python2.7.3/local/lib/python2.7/site-packages/requests/utils.py", line 521, in default_user_agent
_implementation = platform.python_implementation()
AttributeError: 'module' object has no attribute 'python_implementation'
@reddypdl can you do python -c 'import platform; print(platform.python_implementation())', if not can you tell us how you built this version of Python? The platform module is a standard library module and platform.python_implementation() has been around since Python 2.3 so if this is a real version of Python 2.7, then that function should be present. Also is it possible you have a platform.py file in the same directory? If so, please rename it.
Thanks sigmavirus24 , i had a python package called platform in the same folder , so it was picking-up automatically.
Most helpful comment
Thanks sigmavirus24 , i had a python package called platform in the same folder , so it was picking-up automatically.