In Windows 11, I opened the PowerShell terminal and entered some commands to create a local Python environment called env_name. I used the pyenv-win-venv commands like this:
pyenv-win-venv install 3.8.5 env_name
pyenv-win-venv activate env_name
pyenv-win-venv local env_name
Then, I opened Visual Studio Code. I pressed Ctrl + Shift + P to bring up the command palette and selected Python: Select Intepreter. But I didn't see the env_name interpreter in the list.
However, when I used pyenv-virtualenv commands instead:
pyenv local 3.12.7
pyenv shell 3.12.7
virtualenv -p3.12.7 env_name
Visual Studio Code could recognize this new environment. And in the Python: Select Intepreter option, there was a new entry Python 3.12.7 ('env_name': venv).\env_name\Scripts\python.exe. So, I'm wondering how to make pyenv-win-venv work properly with Visual Studio Code just like virtualenv does.
In Windows 11, I opened the PowerShell terminal and entered some commands to create a local Python environment called
env_name. I used thepyenv-win-venvcommands like this:pyenv-win-venv install 3.8.5 env_name pyenv-win-venv activate env_name pyenv-win-venv local env_nameThen, I opened Visual Studio Code. I pressed
Ctrl + Shift + Pto bring up the command palette and selectedPython: Select Intepreter. But I didn't see theenv_nameinterpreter in the list.However, when I used
pyenv-virtualenvcommands instead:pyenv local 3.12.7 pyenv shell 3.12.7 virtualenv -p3.12.7 env_nameVisual Studio Code could recognize this new environment. And in the
Python: Select Intepreteroption, there was a new entryPython 3.12.7 ('env_name': venv).\env_name\Scripts\python.exe. So, I'm wondering how to makepyenv-win-venvwork properly with Visual Studio Code just likevirtualenvdoes.