The solution to the inexplicable report module 'urllib' has no attribute 'request'

The program that used to run well under pycharm, today added two logs, inexplicably reported an error saying that the request could not be found under urllib...
Error: module 'urllib' has no attribute 'request'

After checking, it is said that python3 sometimes will not automatically import submodules into it, so it is safe to change it to:

import urllib.request

That's it... so speechless

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325175926&siteId=291194637