You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: Can't get shell-specific version to be working #193
Describe the bug
After the installation of Pyenv with Chocolatey, it appears that I cannot get the shell-specific version to be working.
To Reproduce
Steps to reproduce the behavior:
Go to PowerShell
Run pyenv shell, this should output no shell-specific version configured
Run pyenv shell 3.8.0
Run pyenv shell, this should output no shell-specific version configured
Expected behavior
The latter execution of pyenv shell should indicate that the shell-specific Python version should be 3.8.0, or other versions as intended.
Desktop (please complete the following information):
I can also observe this issue. It seems to be specific to the PowerShell, if I do this in the classical command prompt cmd.exe then pyenv shell works as expected though.
Can confirm it is PowerShell related issue as @molinav indicated.
cmd:
Microsoft Windows [Version 10.0.19042.630]
(c) 2020 Microsoft Corporation. All rights reserved.
C:\Users\Sirakorn.Lamyai>pyenv shell
no shell-specific version configured
C:\Users\Sirakorn.Lamyai>pyenv versions
2.7.17
* 3.7.7 (set by C:\Users\Sirakorn.Lamyai\.pyenv\pyenv-win\version)
3.8.0
3.8.2
C:\Users\Sirakorn.Lamyai>pyenv shell 3.8.0
C:\Users\Sirakorn.Lamyai>pyenv shell
3.8.0
PowerShell:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\Users\Sirakorn.Lamyai> pyenv shell
no shell-specific version configured
PS C:\Users\Sirakorn.Lamyai> pyenv shell 3.8.0
PS C:\Users\Sirakorn.Lamyai> pyenv shell
no shell-specific version configured
because the set command is not having any effect. But if you type e.g. $env:PYENV_VERSION='3.9.0' in PowerShell, after that pyenv shell will return that the current Python version is 3.9.0.
Bump? This is still an issue and looking into the current pyenv.vbs file the pyenv shell command doesn't even do anything anymore.
Very annoying considering VSCode has a hardcoded pyenv shell {whatever} command running when you open a terminal if you have a custom env selected for the workspace...
I am on pyenv-win version 2.64.11 and this is still an issue for me in PowerShell
did you tried taking latest code? from master
Sorry for the delay. I was getting this issue when I had the latest version installed via scoop. I removed this and installed directly using the powershell script and it now works as expected. Thanks.
The scoop installer doesn't create a shim for the pyenv.ps1 file. But you need this powershell script to be run for the shell command to work, otherwise the PYENV_VERSION env won't be set.
So currently, the scoop "version" only works with CMD.
Activity
kirankotari commentedon Nov 17, 2020
@srakrn did you installed any python ?
srakrn commentedon Nov 17, 2020
Yes, I have installed a few of them. Both
pyenv globalandpyenv localworks perfectly.Also my paths accordingly
molinav commentedon Nov 21, 2020
I can also observe this issue. It seems to be specific to the PowerShell, if I do this in the classical command prompt
cmd.exethenpyenv shellworks as expected though.srakrn commentedon Nov 27, 2020
Can confirm it is PowerShell related issue as @molinav indicated.
cmd:
PowerShell:
molinav commentedon Nov 28, 2020
The problem seems to be with this line of code:
because the
setcommand is not having any effect. But if you type e.g.$env:PYENV_VERSION='3.9.0'in PowerShell, after thatpyenv shellwill return that the current Python version is 3.9.0.molinav commentedon Nov 28, 2020
It is probably related to this:
https://stackoverflow.com/questions/49027851/setting-environment-variables-with-batch-file-lauched-by-powershell-script
WillyJL commentedon Jul 5, 2021
Bump? This is still an issue and looking into the current
pyenv.vbsfile thepyenv shellcommand doesn't even do anything anymore.Very annoying considering VSCode has a hardcoded
pyenv shell {whatever}command running when you open a terminal if you have a custom env selected for the workspace...pyenv shell support in PowerShell
pyenv shell support in PowerShell
devmcp commentedon May 16, 2022
I am on pyenv-win version 2.64.11 and this is still an issue for me in PowerShell
kirankotari commentedon May 16, 2022
did you tried taking latest code? from
masterdevmcp commentedon May 25, 2022
Sorry for the delay. I was getting this issue when I had the latest version installed via scoop. I removed this and installed directly using the powershell script and it now works as expected. Thanks.
Aziks0 commentedon May 25, 2022
The scoop installer doesn't create a shim for the
pyenv.ps1file. But you need this powershell script to be run for theshellcommand to work, otherwise thePYENV_VERSIONenv won't be set.So currently, the scoop "version" only works with CMD.