Skip to content Skip to sidebar Skip to footer

Deactivate Pyenv In Current Shell

My .bashrc has this: enable-pyenv () { # Load pyenv automatically by adding # the following to your profile: export PATH='$HOME/.pyenv/bin:$PATH' eval '$(pyenv ini

Solution 1:

Solution 2:

To deactivate from current shell environment, try pyenv shell --unset

Solution 3:

I'm not sure that this will get rid of all traces of pyenv, but editing your $PATH environment variable to get rid of the pyenv- or shim-containing paths seems to deactivate pyenv. Eg,

export PATH=`echo$PATH | python -c "import sys, re; print(':'.join(x for x in sys.stdin.read().strip().split(':') if not 'pyenv' in x))"`

If you want to be able to re-enable it, just store your previous $PATH so you can restore it later.

Solution 4:

Try playing around with some variants of:

env -i bash

env -i bash -l

env -i bash --norc

env -i bash --norc --noprofile

This does not come without side effects as env -i nukes your whole session and thus afterwards a lot of convenience like $HOME is gone with the bathwater, but so is pyenv.

Solution 5:

None of the posted answers worked for me but the following did:

$ echo "" > /home/myusername/.pyenv/version

Post a Comment for "Deactivate Pyenv In Current Shell"