I am trying to run a script in python3 (tried with 3.7.4 and 3.8.0) which uses urllib.request
and urllib.error
.
I tried importing in the following ways:
import urllib
and
from urllib import request
but in both the above cases I get error:
AttributeError: module 'urllib' has no attribute 'request'
I haven't installed anything related to urllib
as it comes with python3
Please suggest how should this be imported, thanks!
urllib.py
? – Barhorstimport urllib.request
worked for me, thanks! – Margretimport urllib.request
worked for me"—that seems unlikely considering the error you were getting. Voting to close as "not reproducible". – Barhorst