Despite the fact that Python is still a popular programming language, Apple has decided not to include it with MacOS.

If you’re one that frequently uses it, then you may want to know how to make it the default in MacOS.

Here’s how:

  1. Open Terminal (Finder > Utilities).
  2. To make this easy, we’re gonna use nano for the editor.  Go ahead and open it, like this: nano ~/.zshrc
  3.  Add the following to the bottom of the file: alias python=/usr/local/bin/python3
  4. Hit [Control+O] and then [Control+X] to save the edit and then exit out of nano.
  5. Now you need to verify that the changes have been made.
  6. At the prompt, type: python –version
  7. Remember this is only an alias.
  8. If you continue to have the original Python 2.7.x release installed on the Mac, it remains accessible and usable by specifying the full path, like so: /usr/bin/python
  9. That’s it.

For those who don’t know, Apple has been wanting to get rid of Python for a while, and the company has taken this time to do so, as described below:

Deprecations
Python 2.7 was removed from macOS in this update. Developers should use Python 3 or an alternative language instead. (39795874)

About Post Author

(Visited 121 times, 1 visits today)


Advertisement

Dan Uff
Senior Writer / Owner
https://www.compuscoop.com/