My .bashrc
has this:
enable-pyenv () {
# Load pyenv automatically by adding
# the following to your profile:
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
}
enable-pyenv
Which enables pyenv. In some situations, I want to (temporarily) disable pyenv. How can I do this?
#enable-pyenv
and open a new bash session. If it is acceptable to open a new bash session for you, just remember that .bashrc is read only when a bash is initialized. – Blandinapyenv init -
in a shell and you'll see the shell code relative to your bash. So i would create a script with the reverse function to call it when you want to turnoff pydev. I'm speaking theoretically, I don't know how pydev works. – Blandinapyinit()
which initialisespyenv
, prepends its shim directory to the$PATH
and does some further initialisation. In other words,pyenv
is not active until I want it to be. If I have already activatedpyenv
in my current shell and I need to get rid of it, I just open a new shell — cheap and easy on modern hardware. – Deflowerpyenv shell --unset
- Frompyevn shell --help
: > When-
is passed instead of the version string, the previously set version will be restored. With--unset
, thePYENV_VERSION
environment variable gets unset, restoring the environment to the state before the firstpyenv shell
call. – Libby