The solution of module ‘urllib’ has no attribute ‘request’

For programs that used to run well under pychar, two logs were added today. For no reason, an error was reported, saying that no request could be found under urllib…
an error was reported: module ‘urllib’ has no attribute ‘request’

After checking, it is said that sometimes Python 3 will draw wind and will not automatically import submodules into it, so for the sake of safety, it should be changed to:

import urllib.request

That’s it… It’s speechless

Similar Posts: