Hot answers tagged


You can accomplish this by adding export PATH="/path/to/python:"$PATH to your ~/.zshrc (or ~/.bash_profile if you're not on Catalina). I'd like to propose an alternative and suggest pyenv, available via Homebrew. You can set a specific Python version to be "global" (i.e. default everywhere) and/or "local" (i.e. using that version in a specific directory ...


I installed Python 3.8 for macOS using the installer from, not homebrew which is also installed on my Mac but rarely used. I think the first three lines below to my ~/.bash_profile was automatically added by the installer from With those, any changes I make using pip3 seem to affect only the 3.8 whereas those made via pip seem to ...


chown the usr/local directory: sudo chown -R $(whoami) /usr/local Then try to install python3 again and it should work: brew install python3 OR, You can try this also if the above solution didn't help sudo chown -R $(whoami) $(brew --prefix)/* Reference:

2 Define environment variable PYENV_ROOT to point to the path where pyenv repo is cloned and add $PYENV_ROOT/bin to your $PATH for access to the pyenv command-line utility. $ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile $ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/....


If you have homebrew installed you can type in the terminal: brew install python3 Otherwise you can just download it again from the website and install it. If you don't know which version of python you have installed type python --version or python3 --version. Similar questions have been answered on SO and other websites.

Only top voted, non community-wiki answers of a minimum length are eligible