close

[Solved] AttributeError: partially initialized module ‘requests’ has no attribute ‘get’

Hello Guys, How are you all? Hope You all Are Fine. Today I am using request package and I am trying to get some webpage But I am facing following error AttributeError: partially initialized module ‘requests’ has no attribute ‘get’ in Python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How AttributeError: partially initialized module ‘requests’ has no attribute ‘get’ Error Occurs ?

I am using request package and I am trying to get some webpage But I am facing following error.

response = requests.get(url) 
AttributeError: partially initialized module 'requests' has no attribute 'get' (most likely due to a circular import)

How To Solve AttributeError: partially initialized module ‘requests’ has no attribute ‘get’ Error ?

  1. How To Solve AttributeError: partially initialized module ‘requests’ has no attribute ‘get’ Error ?

    To Solve AttributeError: partially initialized module ‘requests’ has no attribute ‘get’ Error Just make sure that your file name and your module name Must be not Same meanwhile You cant use module name as your file name. Once it’s correct, you should have something like this: import requests r = requests.get(“http://google.com”) Now your error might be solved.

  2. AttributeError: partially initialized module ‘requests’ has no attribute ‘get’

    To Solve AttributeError: partially initialized module ‘requests’ has no attribute ‘get’ Error Just make sure that your file name and your module name Must be not Same meanwhile You cant use module name as your file name. Once it’s correct, you should have something like this: import requests r = requests.get(“http://google.com”) Now your error might be solved.

Solution 1: Make sure your file name and module name not same

Just make sure that your file name and your module name Must be not Same meanwhile You cant use module name as your file name. Once it’s correct, you should have something like this:

import requests

r = requests.get("http://google.com")       
print(r.status_code)

# 200

Now your error might be solved.

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Leave a Comment