I've been stuck on this for a few days, kindly help me if you can.
I have my venv folder on my root project folder. When I try to set the Python Interpreter, it shows me only the Python installed in my machine and not the one in my root folder.
It was working fine until I formatted my PC and installed windows 10 64 bits. (was running on windows 7 64 bits prior)
Things I have tried:
pythonPath
and/or venvPath
, in both workspace and user settings: "python.pythonPath": "F:/Web Dev/Python/Django/project_x_v2/backend/venv/Scripts/python.exe",
"python.venvPath": "F:/Web Dev/Python/Django/project_x_v2/backend/venv/Scripts/python.exe",
It shows me the correct location in the placeholder but I don't have the option to choose it from the dropdown list:
Any ideas how I can solve this?
Thank you very much.
EDIT:
~\AppData\...
is located in the disk C:\ while my venv is located in the disk F:. I am not sure whether that is relevant though;This is because VSCode is not using the correct python interpreter. There are two ways in which you can fix this. 1. Update Venv Path Settings in VSCode Open VSCode preferences ( Ctrl + ,) and search for “venv”. Add ~/.virtualenvs to the “Venv Path” settings, like so: Restart VSCode and click on the interpreter version on the left-bottom corner.
This is because VSCode is not using the correct python interpreter. There are two ways in which you can fix this. 1. Update Venv Path Settings in VSCode Open VSCode preferences ( Ctrl + ,) and search for “venv”.
Open VSCode preferences ( Ctrl + ,) and search for “venv”. Add ~/.virtualenvs to the “Venv Path” settings, like so: Restart VSCode and click on the interpreter version on the left-bottom corner. Now, you will be able to see the virtual environment python interpreter in the interpreter list. Select it, now the issue should be resolved. 2.
Open VSCode preferences ( Ctrl + ,) and search for “venv”. Add ~/.virtualenvs to the “Venv Path” settings, like so: Restart VSCode and click on the interpreter version on the left-bottom corner.
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:
venv\scripts\activate
. Keep in mind that the first name "venv" can vary.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.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With