VS Code: Python Interpreter can't find my venv
The only solution I found was to delete the
venvand recreate it. I followed these steps but I'll provide a brief summary for Windows:
- Activate your virtualenv. Go to the parent folder where your Virtual Environment is located and run
venv\scripts\activate. Keep in mind that the first name "venv" can vary.
- Create a requirements.txt file.
pip freeze requirements.txt
deactivateto exit the venv
rm venvto delete the venv
py -m venv venvto create a new one
pip install -r requirements.txtto install the requirements.
"python.venvPath" setting (it doesn't do what you seem to think it does), don't specify these settings in your user settings, and change your
"python.pythonPath" to be relative to your project, e.g.: