简体   繁体   中英

ModuleNotFoundError: No module named 'requests' in VSCODE

I ran the code import requests in my file and this error come out ModuleNotFoundError: No module named 'requests'

Things I have tried:

  1. installed requests in both windows terminal and vscode terminal that gives the output Requirement already satisfied
  2. ran pip freeze requests==2.25.1 is registered
  3. tried ./pip freeze on the terminal to check if i'm on the wrong terminal as https://stackoverflow.com/a/58160615/15232456 suggests and error: The term './pip' is not recognized
  4. Tried adding the workspace settings path in vscode
{
    "python.pythonPath": "${c:/dev/ala/venv/Scripts/python.exe}/code/venv/bin/python"
}

Perhaps something wrong in this implementation?

Edit: "python.pythonPath" has been replaced by "defaultInterpreterPath"?

so I tried this instead:

{
    "defaultInterpreterPath": "${c:/python36/python.exe}/code/venv/bin/python"
}

Need help, thanks.

Have you tried installing requests with:

python3 -m pip install requests or

python -m pip install requests or

py -m pip install requests ?

What does VSCODE use?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM