How can I use Homebrew to install both Python 2 and 3 on Mac?
问题 I need to be able to switch back and forth between Python 2 and 3. How do I do that using Homebrew as I don't want to mess with path and get into trouble. Right now I have 2.7 installed through Homebrew. 回答1: I would use pyenv You can install it: $ brew install pyenv To enable pyenv in your Bash shell, you need to run: $ eval "$(pyenv init -)" To do this automatically for Bash upon startup, add that line to your ~/.bash_profile . 1 Usage: Once you have installed pyenv and activated it, you