i am using visual studio code to run code, it is working fine for most of the imports, except when i try to import the urllib module.
consider this code:
import urllib.request
x = urllib.request.urlopen('https://www.google.com/')
print(x.read())
when i run it on idle it works just fine, but if i run it on visual studio code i get an error:
File "c:\MyPythonScripts\dictionary Python\urllib.py", line 2, in import urllib.request ModuleNotFoundError: No module named 'urllib.request'; 'urllib' is not a package
i have searched everywhere trying to find a solution to this issue, since i am also having the same problem when i import the shelve module as well.
any idea would be highly appreciated, or should i even stop using Visual studio code altogether ?