Deactivate pyenv in current shell

前端 未结 7 2076
日久生厌
日久生厌 2021-02-13 02:22

My .bashrc has this:

enable-pyenv () {
    # Load pyenv automatically by adding
    # the following to your profile:

    export PATH=\"$HOME/.pyenv/bin:$PATH\"
         


        
7条回答
  •  礼貌的吻别
    2021-02-13 03:04

    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.

提交回复
热议问题