To build a web scraping program in python 3 I do the following
import urllib.request
I use a venv, which is selcted and shown on the bottom left in VS Code. The settings.json
file has:
"python.pythonPath": "venv/bin/python"
Also the integrated terminal has been closed and reopened multiple times. Entering pip list
shows request
as installed for that venv.
If I run the file no problems come up but in output it keeps saying
Traceback (most recent call last):
File "/Users/filepath/filename.py", line 2, in
<module>
import urllib.request
ImportError: No module named request
Important: The last time I had this file open, everything was fine with importing that module. Now after saving and reopening that project next day I keep getting this error message over and over again.
I really hope someone can help! Thanks!