Importing a library from (or near) a script with the same name raises “AttributeError: module has no attribute” or an ImportError or NameError
This happens because your local module named requests.py shadows the installed requests module you are trying to use. The current directory is prepended to sys.path, so the local name takes precedence over the installed name. An extra debugging tip when this comes up is to look at the Traceback carefully, and realize that the name … Read more