Installation
On most systems you can end up with multiple versions of Python installed and this can be confusing. We're going to set it up once so that we're using the latest version (3.10 or 3.11 at the time of this writing) and only that version.
You cannot avoid having multiple versions of Python installed because older Macs and Linux distributions come with version 2.7 installed by default so you might see this:
It's important to note that Python 2.x is a really really old version of Python, more than 10 years old. You never want to use it and most of what we're writing won't work in Python 2.7.
Install Python 3:
Homebrew will install 3.10 by default instead of 3.11, this is fine.
On Ubuntu, you should already have a reasonably recent version of Python installed. Check your version with:
Set Up the python
Alias
python
AliasOpen your shell's configuration file, for zsh
:
and paste this at the bottom:
Close your terminal window and open a new one. In any new terminal window from this point you can now just type python
instead of python3
.
Last updated
Was this helpful?