VS Code: Python Interpreter can't find my venv
The only solution I found was to delete the venv
and 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
deactivate
to exit the venvrm venv
to delete the venvpy -m venv venv
to create a new onepip install -r requirements.txt
to install the requirements.
Drop the "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.:
"python.pythonPath": "venv/Scripts/python.exe"