Setting a predictable default Python interpreter matters when terminal commands, editor tasks, or lightweight automation invoke python without a version suffix. Choosing that command explicitly avoids bouncing between runtimes on hosts that keep several Python 3 minor versions installed side by side.
On Linux and macOS, the shell resolves python by searching the directories in PATH from left to right. Current PEP 394 guidance leaves the unversioned python command flexible on Unix-like systems, so one host may map it to Python 3, another may omit it entirely, and an activated virtual environment may temporarily replace it with a project-local interpreter.
A user-owned shim in ~/.local/bin keeps the change inside one account and puts that directory ahead of the rest of the interactive shell path. Scripts that call an explicit interpreter path, shebang-managed entry points, and activated virtual environments continue to select their own runtime instead of inheriting the user default blindly.
Related: How to check Python version
Related: How to create a virtual environment in Python
$ command -v python3.14 /usr/local/bin/python3.14
Replace python3.14 with the installed interpreter that should become the default, such as python3.13 or python3.12. Other systems may resolve the binary under /usr/bin, /usr/local/bin, or an Apple Silicon Homebrew prefix such as /opt/homebrew/bin.
$ mkdir -p ~/.local/bin
$ ln -sf "$(command -v python3.14)" ~/.local/bin/python
This changes only the unversioned python command for the current user. PEP 394 recommends implementing a configurable python command as a link to the interpreter rather than replacing the interpreter binary itself.
$ vi ~/.zshrc export PATH="$HOME/.local/bin:$PATH"
Use /.bashrc for non-login Bash shells, /.bash_profile or /.profile for login Bash shells, and /.zshrc for Zsh.
$ source ~/.zshrc $ hash -r
Replace /.zshrc with the file edited in the previous step, such as /.bashrc or /.bash_profile.
$ command -v python /Users/analyst/.local/bin/python $ python --version Python 3.14.3 $ python -c "import sys; print(sys.executable)" /usr/local/opt/python@3.14/bin/python3.14
sys.executable shows the interpreter that actually ran after following the shim. An activated virtual environment prepends its own bin directory and temporarily overrides this selection until the environment is deactivated.