how to uninstall pyenv(installed by homebrew) on Mac

David Chan picture David Chan · Aug 11, 2018 · Viewed 37.3k times · Source

I used to install pyenv by homebrew to manage versions of python, but now, I want to use anaconda.But I don't know how to uninstall pyenv.Please tell me.

Answer

Jyoti prakash picture Jyoti prakash · Aug 11, 2018

From the docs:

Uninstalling pyenv

The simplicity of pyenv makes it easy to temporarily disable it, or uninstall from the system.

  1. To disable pyenv managing your Python versions, simply remove the pyenv init line from your shell startup configuration. This will remove pyenv shims directory from PATH, and future invocations like python will execute the system Python version, as before pyenv.

pyenv will still be accessible on the command line, but your Python apps won't be affected by version switching.

  1. To completely uninstall pyenv, perform step (1) and then remove its root directory. This will delete all Python versions that were installed under $(pyenv root)/versions/ directory:

    rm -rf $(pyenv root)
    

    If you've installed pyenv using a package manager, as a final step perform the pyenv package removal. For instance, for Homebrew:

     brew uninstall pyenv