Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to uninstall pyenv(installed by homebrew) on Mac

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.

like image 276
David Chan Avatar asked Aug 11 '18 06:08

David Chan


People also ask

Where is Pyenv installed?

If pyenv is run as the root user then it will be installed to /usr/local/pyenv, otherwise it will be installed to the users ~/. pyenv directory. To make pyenv available in the shell you may need to add the pyenv/shims and pyenv/bin directories to the users PATH.


2 Answers

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.

  2. 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 
like image 81
Jyoti prakash Avatar answered Sep 28 '22 03:09

Jyoti prakash


Try removing it using the following command:

brew remove pyenv

like image 26
Dan Nagle Avatar answered Sep 28 '22 04:09

Dan Nagle