Python Upgrade Mac



Use Python 3 as the macOS default Python's website has a macOS Python 3 installer we can download and use. If we use the package installation, a python3 fill will be available in /usr/local/bin/. Aliasing is a must since the Python binary stored in /usr/bin/ can't be changed. Install Python 3 on MacOS. Historically MacOS came preinstalled with Python 2, however starting with Mac 10.15 (released in October 2019) this is no longer the case.And since Python 2 will no longer be officially supported as of January 1, 2020, you should really use Python 3 instead. Enumerating the changes in the detailed release notes, the developers write that “As of 3.9.1, Python now fully supports building and running on macOS 11.0 (Big Sur) and on Apple Silicon Macs. Doing it Right¶. Let’s install a real version of Python. Before installing Python, you’ll need to install GCC. GCC can be obtained by downloading Xcode, the smaller Command Line Tools (must have an Apple account) or the even smaller OSX-GCC-Installer package. Go to the Python website's download page. It should auto-detect that you're on a Mac and offer you some options. You're probably wanting 3.4.1. The interesting part of the page will look something.

  1. Mac Python Upgrade To 3.9
  2. Upgrade Python Mac Command Line

May 29th, 2020

  • Link toInstalling the latest version of Python on Mac OS Catalina and overriding the old default pre-installed versionpodcast on anchorfm

I finally did it. I successfully installed Python version 3.7.7 viaHomebrew on my Maclaptop with OS Catalinainstalled.

For those of you that still might be trying to figure outhow todo this, I will walk you through.

The reason why I was eager to make sure that I had the latest versioninstalled was because I am working on publishing (open-source)teaching-relateddocumentation on Read The Docs, and I need to havePythoninstalled in order to be able to install the programsnecessary to publishthere.

The default2.7.17 version of Python was retired this pastJanuary 2020. I had tried back then to replace it with Python 3+,but was unsuccessful at the time. The following is what I did today:

First I updated Homebrew. Yes, I used Homebrew to (re)installPython. It’s really easy. It’s just a matter of putting the pieces of thepuzzle together correctly!

I ran the command

To updateHomebrew. Then I ran the command

To (re)install Python. Then I ran

To see which version of Python my Mac laptop was recognizing. Itstill recognized only Python 2.7.17. So I ran the followingcommand:

It told me the path to my newly installedPython 3.7.7. I had tochange the path to Python in order for my Mac to recognize thenewly installed version. This is what the command brew info python returned tome in Terminal:

So I had to add the following at the bottom of my .zshrc fileto update the path to my newly installed version of Python viaHomebrew:

Then I made sure to quitTerminal and go back in so that the pathwould actually be updated in a newTerminal windowinstance.

Then I checked what version of Python was recognized now with

Python upgrade mac os

And this is what was returned:

Success! It’s as easy as that.

And BTW, if you don’t know how to access your .zshrc file in Catalina,you simply execute the following command:

And your file will open in a new window. Then you can paste

At the bottom of the file.

I will be embedding this episode of Plugging in The Holes along with atranscript in the form of a post oninterglobalmedianetwork.com for yourhearing and reading pleasure. Bye for now!

Related Resources

Categorized under:osxpython3catalina

Created by Maria D. Campbell who lives and works in New York City building useful things.You should follow her on Twitter. She also has a developer blogmariadcampbell.comyou may want to check out!

Learn how to upgrade Python 3.6 to Python 3.7 on Mac OS.

This post has been updated on How to Update Python 3.6 to Python 3.8 on Mac OS. This post will be removed end of this month.

Python Official Site

1) Open up Python official download site. It looks something like the image below. Press Download Python 3.7.4 or the version you would like to download.

2) Use the download installer to install Python 3.7. You can refer to How to Install Python3 article for more information.

Homebrew

If you use Homebrew, you can run brew install command to update Python to Python 3.7

Verification

After you install, python3 command will point to Python 3.7. You can verify by using commands below.

You can use which command to find out the location of Python 3.7

Note

You can check out How to Install Pip article to learn how to install Pip.

Support Jun

Thank you for reading!

Mac Python Upgrade To 3.9

If you are preparing for Software Engineer interviews, I suggest Elements of Programming Interviews in Java for algorithm practice. Good luck!

You can also support me by following me on Medium or Twitter.

Upgrade Python Mac Command Line

Feel free to contact me if you have any questions.