I am new to the library of requests. I am trying to import the library requests and was learning from geekforgeeks about the library(https://www.geeksforgeeks.org/python-requests-tutorial/. The following is the code
import requests
print(dir(requests))
the following is the output
Traceback (most recent call last):
File "C:\Users\SUCHIISWAR\AppData\Local\Programs\Python\Python310\noth.py", line 1, in <module>
import requests
File "C:\Users\SUCHIISWAR\AppData\Local\Programs\Python\Python310\requests.py", line 4, in <module>
r = requests.get('https://api.github.com/users/naveenkrnl')
AttributeError: partially initialized module 'requests' has no attribute 'get' (most likely due to a circular import)
To fix the problem i referred to this question on stack overflow https://stackoverflow.com/questions/59035409/python-import-requests-results-in-traceback-partially-initialized-module-req
File "C:\Users\SUCHIISWAR\AppData\Local\Programs\Python\Python310\noth.py", line 1, in <module>
import requests
File "C:\Users\SUCHIISWAR\AppData\Local\Programs\Python\Python310\requests.py", line 4, in <module>
r = requests.get('https://api.github.com/users/naveenkrnl')
This part of the error is not even part of the document in which i am writing code but an altogether different .py file in which i was working before the code displayed to you.
enter image description here This is the name of the different .py file i was talking about
I tried referring to the stack overflow question and tried renaming the file. It did not make any difference