Не могу автоматически активировать виртуальную среду в vscodePython

Программы на Python
Anonymous
Не могу автоматически активировать виртуальную среду в vscode

Сообщение Anonymous »


I'm trying to automatically activate the virtual environment .venv in the terminal whenever I open the VS Code workspace. I have Python installed via pyenv.

I tried adding the following in both the user settings JSON file and the workspace settings JSON

"python.terminal.activateEnvInCurrentTerminal": true, "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python", but that did not work, I still need to run source .venv/bin/activate in the terminal whenever I launch the workspace to activate the virtual environment

I use pip -V in the terminal to verify which Python interpreter is being used like follows:
Изображение


I want pip -V to point to my virtual environment every time I open up VS Code without the need to run source .venv/bin/activate


Источник: https://stackoverflow.com/questions/780 ... -in-vscode

Вернуться в «Python»