How to fix AttributeError:partially initialized module?

后端 未结 2 1583
南方客
南方客 2020-12-21 03:48

I am trying to run my script but keep getting this error:

File ".\\checkmypass.py", line 1, in 
    import requests line 3, in 

        
2条回答
  •  一整个雨季
    2020-12-21 03:58

    Have you checked the name of the file? it should not be as same as the module you are importing (circular). Also check the URL and the package you are using. "Most likely due to a circular import" refers to a file (module) which has got a dependency on something else and is trying to be imported while it's already been imported. Then while checked, you should have something like this:

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

提交回复
热议问题