Home >Backend Development >Python Tutorial >How Can I Make Python 3 the Default Python Version on macOS?
Setting Python 3.x as the Default on macOS
To set Python 3.x as the default on macOS, you can create an alias in your shell.
Steps:
alias python='python3'
For bash (macOS 10.14 and below):
[ -e ~/.profile ] && . ~/.profile
For zsh (macOS 10.15 and later):
[ -e ~/.profile ] && . ~/.profile
Note: Changing the default Python executable system-wide may break applications that depend on Python 2. To avoid this, you can create an alias instead of modifying the default executable.
Additional Tips:
The above is the detailed content of How Can I Make Python 3 the Default Python Version on macOS?. For more information, please follow other related articles on the PHP Chinese website!