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
In pyenv/pyenv#1914, a user was getting the Failed to activate virtualenv. Perhaps pyenv-virtualenv has not been loaded into your shell properly. message when trying to pyenv activate in a noninteractive shell.
Is pyenv activate supposed to be usable in this scenario?
If yes, Pyenv-virtualenv's -- and also Pyenv's -- documentation needs to be rewritten to install shell functions into both interactive and non-interactive shells -- including the case when the login shell and the running shell are different shells.
I'm not sure if this is a good idea: it's going to be disruptive, requiring stuff like setting BASH_ENV and creating a new script file.
If no, the error message needs to be fixed to not read like a configuration error but instead instruct the user to source the activation script directly or something.
The text was updated successfully, but these errors were encountered:
native-api
changed the title
Is pyenv activate supposed to be usable in noninterative shells?
Is pyenv activate supposed to be usable in noninteractive shells?
May 26, 2021
I find this rather interesting. I'm trying to set up a Docker image where pyenv is available and usable (for both production and development purposes), and it would be interesting to know what the maintainers have to say here.
From what I can see in the codebase, Pyenv has never loaded, or it's documentation suggested to load by default, shell integration into noninteractive shells. Probably because that's prone to breaking scripts.
So if you need commands like activate that need shell integration, in noninteractive shells, you need to run the necessary init commands manually or change shell startup files accordingly.
In pyenv/pyenv#1914, a user was getting the
Failed to activate virtualenv. Perhaps pyenv-virtualenv has not been loaded into your shell properly.
message when trying topyenv activate
in a noninteractive shell.OS: Debian Buster 10 (AWS / EC2)
Pyenv: 2.0
Pyenv-virtualenv: 1.1.5
Debug trace: pyenv/pyenv#1914 (comment)
Is
pyenv activate
supposed to be usable in this scenario?BASH_ENV
and creating a new script file.source
the activation script directly or something.The text was updated successfully, but these errors were encountered: