Header Ads


How to Install Updated Python 3.6.x on Mac

How to Install Updated Python 3.6.x on Mac

How to Install Updated Python 3.6.x on Mac
How to Install Updated Python 3.6.x on Mac

Python is a popular programming language that is widely used by beginners and longtime developers alike. Modern Mac OS versions come with Python 2.7.x installed (or Python 2.6.1 if an older Mac OS X version), but many Python users may need to update Python in Mac OS to a newer version like Python 3.6.5. This article will discuss how to get an updated Python 3 installation on the Mac by covering two different ways to quickly and easily install Python 3 onto a Mac. Note that we said install Python 3, not update to Python 3, because how this will work is installing Python 3 while simultaneously maintaining Python 2 on the Mac.

How to Install Updated Python 3.6.x on Mac

This is essential because apparently some Mac apps rely on Python 2 support, so if you attempt to upgrade Python 2.x to Python 3.x in Mac OS you will eventually find that something is broken, perhaps critically so. With that in mind you should not attempt to update the existing preinstalled Python release on a Mac, instead you will just have a co-installation of Python 3 for full compatibility. And yes, Python 3 and Python 2 can coexist on a Mac without any conflict, the usage commands will just be slightly different. Perhaps the simplest way to install Python 3 is by using the Python package installer from python.org Python 3.6.x requires about 100mb of disk space to install. Installation is quick, and youll have Python 3.x alongside Python 2.x on the Mac.

Once Python 3 is installed you will find a Python3 folder within the /Applications directory of your Mac. Youll also find the simple IDE called IDLE within the /Applications/MacPython3/ directory, which basically gives you the same Python IDE youd encounter if you ran python3 at the command prompt in Terminal. You can also install Python 3.x on a Mac through Homebrew, which is my preferred method as a Homebrew user. Installing an updated version of Python 3.6.5 (as of time of writing) is super easy with HomeBrew.

How to Install Updated Python 3.6.x on Mac

Of course you will need on the Mac before you can use the Homebrew method, but if youre interested in messing around with Python then Homebrew will probably appeal to you anyway. Were going to assume you already have Homebrew, if you dont the you can . To install the latest version of Python 3 using Homebrew, just issue the following command string: Once the updated Python 3 has been installed on the Mac, you can run it with: Whether you install the updated Python 3 with the package installer or Homebrew, the default version of Python 2.7 that comes preinstalled with Mac OS and Mac OS X will still be installed, completely untouched, and can be run with the simple python command as always.

From the Terminal application, simply typing the following command will report back what version of Python is currently installed: In MacOS, you will find its typically Python 2.7.x of some variation, either 2.7.4 or 2.7.10 or similar. After you have installed Python with Homebrew or with the package installer, you can check the updated new version of Python with: And as mentioned before, both installations of Python will coexist without conflict.

You can also find out where each version of python is installed with the which or whereis command: Note that some aspects of Python are different in each version, and even features like is different from version 2 to version 3. If you're planning on using something longterm, or learning in general, you'll be better off writing in Python 3.x rather than the older Python 2.x releases.

So now that you've got Python 3 installed, you're ready to roll! If you're new to Python and programming in general, there are a variety of great resources out there to get you started. If you're the type to enjoy learning from a book, some popular choices are: You can check out free online courses too, including these from MIT: Or you can also explore the broad Python Wiki too. TLDR: Don't update the preinstalled Python 2.x to Python 3.x, it will likely break something in doing so. Instead, just install and run the updated Python 3 separately.

How to Install Updated Python 3.6.x on Mac

No comments

Powered by Blogger.