I am not able to run requests

recently installed python 3.11.4 but cannot use the requests function.
Traceback (most recent call last):
File “C:/Users/vikas/Documents/1.py”, line 16, in
File “C:/Users/vikas/Documents/1.py”, line 6, in main
response = requests.get(url)
AttributeError: module ‘requests’ has no attribute ‘get’

i tried pip installation, made sure it is the scripts directory where pyhton is installed but still no use.

Is there a file named requests.py in the local directory? Perhaps you are importing that file instead of the installed package. This is a common trap.

You can check the location of requests by adding:

import requests

If it’s not something like C:\Python311\Lib\site-packages\requests\__init__.py (I always install Python into C:\), then it’s picking up the wrong requests.