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


This setting works if you have created virtual environments for each workspace. But for the python executable in the virtual environment folder, the path should be
"${workspaceFolder}\\.venv\\Scripts\\python". there is nobinfolder in the virtual environment folder.Also, in the previous update, a new terminal automatically activates the environment, but the environment name is not displayed in front of the terminal directory.