

Now you can enjoy the latest features and bug fixes in your Python development projects. That’s it! You have successfully updated Python on your Mac.

Now, when you run the python command, it should point to the latest version of Python. Restart your Terminal, or type the following command to apply the changes: Save the file and exit nano by pressing Ctrl + X, then Y, and then Enter. Make sure to replace “3.9” with the version number of the Python you just installed. Add the following line at the end of the file:Įxport PATH=”/usr/local/opt/ /bin:$PATH” This will open your shell configuration file in the nano text editor. Open the Terminal and type the following command: If you want to use the latest version of Python by default, you can update your PATH. Step 4: Update your PATH (optional)īy default, when you run the python command in the Terminal, it will still point to the older, system-level version of Python. This is because macOS still uses the older version of Python as the default for system-level tasks, and we don’t want to interfere with those processes. Note that we use python3 instead of python to refer to the newly installed Python. Once the installation is complete, you can check your Python version again:

This will install the latest version of Python and its dependencies. Next, install the latest version of Python using the following command: First, update Homebrew to ensure you have access to the latest packages: Now that you have Homebrew installed, you can use it to update Python. Step 3: Update and install Python with Homebrew Press Enter and follow the prompts to complete the installation. bin/bash -c “$(curl -fsSL )” report this ad To install Homebrew, open the Terminal and paste the following command: We will use Homebrew to install the latest version of Python. Homebrew is a package manager for macOS that makes it easy to install and manage software. For example: Python 2.7.16 Step 2: Install Homebrew This command will display the current Python version installed on your system.

To check your Python version, open the Terminal app on your Mac and type the following command: Step 1: Check your current Python versionīefore you update Python, it is important to know the version you are currently using. In this blog post, we will walk you through the process of updating Python to the latest version on your Mac. However, the pre-installed version of Python on Mac is usually older and may not have the latest features and bug fixes. Python is a versatile and widely-used programming language that comes pre-installed on macOS.
