Install Python On Mac Catalina

  1. Install Python On Mac Catalina Os
  2. Install Python On Mac Catalina Download

For this blog post, I am going to use python 3.6. Download it from its official site and install it. Given below are the steps you need to follow to build OpenCV on macOS Catalina. Get code examples like'install python macos catalina'. Write more code and save time using our ready-made code examples.

Posted on October 4, 2016 by Paul

Updated 15 June 2021

In this article, I will show you how to install Python with NumPy, SciPy and Matplotlib on macOS Big Sur.

I assume you are on an Intel based Mac. If you have an arm64 Mac, also called Apple Silicon, please check my other article.

MacOS Big Sur comes by default with Python 2.7 which, at this point, receives only bug fixes and is EOL since 2020. Python 3 is the future and it is supported by all major Python libraries. In this tutorial, we’ll use Python 3.9 which is the latest stable release of Python at the time of this writing.

Start by installing the Command Line Tools for macOS. Please note, that you will need the Command Line Tools even if you’ve already installed Xcode. Open a Terminal and write:

Once the Command Line Tools are installed, we can install Python.

As a side note, after you install the Command Line Tools, you will also get a slightly older Python 3 version (3.8). In this article, we are going to use the latest stable version of Python which, at the time of this writing is 3.9.

Python

Go to https://www.python.org/ and download Python. The official installer of Python is a pkg file that will start a GUI installer which will guide you through the installation.

You can have multiple Python 3 versions installed on your macOS machine. If this is the case, you can select which version you want to use by specifying the version number, e.g.:

or:

After the above, you can invoke Python 3.9 using the python3.9 command. python3 will also invoke the latest installer version of Python 3. This is what I see if I run python3.9 on my machine:

Next, let’s follow best practices and create a new Python environment, named work (feel free to use a different name), in which we can install NumPy, SciPy and Matplotlib:

At this point, your prompt should indicate that you are using the work environment. You can read more about Python environments in the documentation.

Once an environment is activated, all the install commands will apply only to the current environment. By default, if you close your Terminal, the environment is deactivated. If you want to be able to use it, use the source work/bin/activate command.

Python

We can install NumPy, SciPy and Matplotlib with:

As a side note, when you are in an active environment you can use the python command to invoke the Python interpreter, no need to use the version number.

Fire up Python, import scipy and print the version of the installed library. This is what I see on my machine:

Let’s try something a bit more interesting now, let’s plot a simple function with Matplotlib. First, we’ll import NumPy and Matplotlib with:

Next, we can define some points on the (0, 1) interval with:

Now, let’s plot a parabola defined on the above interval:

You should see something like this:

Catalina

As you’ve probably noticed, plt.show() is a blocking command. You won’t be able to use the interpreter until you close Figure 1.

There is also an interactive mode in which you can plot functions. Close Figure 1 and write:

This is what you should see:

At any point you can disable the interactive plot mode with:

after which you will need to use the plt.show() function in order to actually see the result of the plt.plot function.

If you want to learn more about Python and Matplotlib, I recommend reading Python Crash Course by Eric Matthes. The book is intended for beginners, but has a nice Data Visualization intro to Matplotlib chapter:

Another good Python book, for more advanced users, which also uses Matplotlib for some of the book projects is Python Playground by Mahesh Venkitachalam:


Show Comments

Quick Links

Install Python On Mac Catalina Os

Have you tried to use Telnet on MacOS only to find out it wasn’t there?You’re not alone, many have been disappointed to find out that Telnet hasbeen removed from modern versions of the system software starting fromMacOS Mojave and newer. These instructions will work for MacOS Mojave andnewer, I happen to be running Big Sur and this is what I did to get Telnetback.

Installing Telnet on MacOS with Homebrew

First I would like to mention that there is an easier route, that is usingHomebrew. I see a lot about it and many people seem happy with it but I havean aversion to putting it on my machine. If you don’t already have Homebrewon your machine, navigate over to the brew website and followthe installation instructions. I would caution against following themexactly though for security purposes. I would do it like this instead:

Open and inspect the install.sh script to see what it does and make sure you feelcomfortable running it on your machine. And then run it.

After installing Homebrew, install Telnet

Installing Telnet on MacOS by Building Telnet from Source

This was the method I used. There are some prerequisite steps though, if youdon’t already have them you’ll need to install the MacOS command line tools.

Step 1: Installing the command line tools

Open a terminal and enter the following line, you’ll then be shown a pop upprompt.

Click install when the prompt pops up.

After that you’ll be shown a license which you’ll have to agree to in orderto install.

After that you’ll see the download progress and the install will happenafter that. Unfortunately I forgot to get screen shots of the followingmessage boxes.

Mac

Step 2: Getting the Telnet source

How to install python 3 on mac catalina

For this step you’ll be getting the GNU network utilitiesnavigate to the download pageand find the latest source. At the time I’m writing this it’s 1.9.4:

Install Python On Mac Catalina Download

Step 3: Extract the source

Step 4: Configure and build

Now that the source is extracted change into the directory:

Run the configure command:

Run the make command to build:

And then install:

Either way you choose is fairly easy, the build for this is pretty straightforward and was very quick. I don’t think it even took me 10 minutes tobuild and install.