If none of the above help you, try renaming your Python module.
In my particular case, the problem was that the file I was running was called http.py Once I changed the name to test-http.py , importing urllib.request fixed the AttributeError: module 'urllib' has no attribute 'request' error AttributeError: module 'urllib' has no attribute 'request'
I noticed that later during the exception tracing, the inner packages tried to get a module named http , so I guessed that my module name was in the order of things ...
JohnnyFun Oct 20 '18 at 6:27 2018-10-20 06:27
source share