Macbook. I’m relatively new to Python, and trying to use a code with import requests
requests package appears to be installed but comes up with error when I try to import requests in VSC.
Not sure if I might’ve installed two versions of Python – one by itself and one when I installed Anaconda. That might be the issue.
Get an error – ModuleNotFoundError: No module named 'requests'
when trying to import request
in Python.
pip lists
in terminal shows requests is installed as a module.
Why is trying to execute import request
in VSC showing no module named requests even though requests is apparently installed?
Tried uninstalling and reinstalling requests in terminal.
conda list
in terminal also shows requests is installed as a module.
which python
shows
/Users/lewisfoggie/anaconda3/bin/python
which -a python
shows
/Users/lewisfoggie/anaconda3/bin/python
/usr/bin/python
‘which pip’ shows
/Users/lewisfoggie/anaconda3/bin/pip
The path for Python listed when I hover over the Python version in the corner of VSC is /usr/bin/python
Am I missing something or something is off?
How might I investigate this further?
Lewis Foggie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.