Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ModuleNotFoundError: No module named 'requests' using venv in vscode

I have 1 file, i get as far as line 1 import requests, nothing more yet and I receive the following error ModuleNotFoundError: No module named 'requests'.

  1. Using Visual Studio Code, installed today with standalone Python x64 3.7.4
  2. Python Extension installed in VSCODE
  3. venv created within VSCODE as a subfolder of workspace withint VSCODE terminal and was recognized by VSCODE when created and I am using venv interpreter in VSCODE as indicated on bottom bar
  4. ran pip install requests within terminal inside VSCODE - completed successfully
  5. ran pip freeze to confirm requests==2.22.0 is registered
  6. Verified pylint was installed in venv

I cannot figure out why VSCODE python interpreter will not recognize that requests is installed

like image 590
Brandon Meyer Avatar asked Dec 31 '22 15:12

Brandon Meyer


1 Answers

try get python version in vscode terminal

python --version

and check python version vscode IDE used by clicking left buttom corner. enter image description here

make sure these 2 versions are consistent. if not, select the version of IDE with the same version of your terminal.

like image 95
Will Wu Avatar answered Jan 04 '23 03:01

Will Wu