Issue
I recently installed pyenv on my Mac using Homebrew. I installed it by entering the command brew install pyenv
in the terminal, that's it. I didn't do any other required steps like executing echo 'eval "$(pyenv init --path)"' >> ~/.zprofile
in the terminal or anything else.
Anyways, I now uninstalled pyenv using the rm -rf $(pyenv root)
command, and then the brew uninstall pyenv
command in the terminal since I didn't use pyenv at all.
My question comes down to, was I supposed to remove the pyenv init invocations from my shell startup configuration before uninstalling pyenv using the rm -rf $(pyenv root)
command? Then follow it by the brew uninstall pyenv
command?
I didn't think I would have to do that step when uninstalling pyenv because, once again, I didn't do any other required steps for installing pyenv, other than just executing the brew install pyenv
command in the terminal.
I am using zsh (if that matters to anyone). If I do have to reinstall pyenv and remove the pyenv init invocations from my shell startup configuration + the other steps used for uninstalling it, then please tell me how to do that task. If I don't have to remove the pyenv init invocations from my shell startup configuration, then ok, that's good.
Solution
pyenv
doesn't write the init script into your zsh init files automatically.
So, if haven't touched .zshrc
, .zprofile
file after installing pyenv
, you don't have to manually remove these pyenv
init script.
And your uninstallation steps are correct:
rm -rf "$(pyenv root)"
removes the folder where compiled python, virtualenv are stored.brew uninstall pyenv
removes the package itself.
Answered By - Simba