Python is a programming language that can be used to make computer programs. The latest version of Python 3 was released this year, but it’s not easy for beginners to install on Macs and PCs. Here are the steps you need to take in order to get up and running with the newest release of Python 。
You’ve come to the correct place if you want to install Python 3.6 on Windows, Mac OS X, or Linux. In this video, you’ll learn how to find out what version of Python you have installed (if any) and how to install Python 3.6.
Identifying the Python Version That Has Been Installed
Python is frequently pre-installed on many *nix and MacOS operating systems, unlike Windows.
Python 2.7 was installed on the PC I’ll be using, which runs MacOS Sierra. Start your terminal and run python —version or python -V to see whether Python is already installed. This will show you what version is installed right away.
This isn’t fully correct, however. Python, unlike PowerShell, may be installed in a variety of locations, and you may have numerous versions installed. Only the python specified in your PATH environment variable is executed when you run the python program.
Also, the alias python refers to any Python 2.x version. The python3 alias is available if you have Python 3.x installed.
python -V Python 2.7.10 $ python -V Python 2.7.10 —version Python 2.7.10 $ python —version Python 3.6.2 $ python3 $ python3 -V Python 3.6.2 $ python3 -V Python 3.6.2 $ python3 –
I have both 2.7.10 and 3.6.2 installed, as you can see above.
Python 3.6 installation on macOS
Python 2 should be avoided at all costs. There seems to be a lot of code still running on 2.x, but 3.x is the way of the future, and I want to make sure I have it loaded.
The HomeBrew program is the recommended method for installing Python 3.x on MacOS. HomeBrew, like PowerShell Gallery, is a package manager that enables users to download and install apps from a public repository.
$ brew install python3 Updating Homebrew… ==> Auto-updated Homebrew! Updated 1 tap (homebrew/core). ==> New Formulae ….. Error: python3 3.6.0 is already installed To upgrade to 3.6.2, run `brew upgrade python3` $ brew upgrade python3 ==> Upgrading 1 outdated package, with result: python3 3.6.2 ==> Upgrading python3 ==> Installing dependencies for python3: readline, sqlite, gdbm, openssl …… ==> Summary ? /usr/local/Cellar/python3/3.6.2: 3,598 files, 55.9MB
As you can see, HomeBrew was already aware that I was running an earlier version of Python 3 and urged me to update, which I did. I’m up to current now that I’ve installed Python 3.6.2. I can verify this by running python3 and looking at the header.
Python 3.6.2 $ python3 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] [GCC 4.2.1 (App Darwin’s theory For further information, type “help”, “copyright”, “credits”, or “license”.
Python installation on Linux is equally as simple as it is on MacOS.
The apt-get package manager may be used to install Python on Ubuntu 16.10 or later.
apt-get update $ sudo apt-get install python3.6 $ sudo apt-get install python3.6
We could perform the following in Fedora:
dnf install python3 $ sudo dnf install python3
Python installation on Windows is as simple as installing any other MSI package you’re familiar to. This is necessary since Python is not installed by default on Windows. To get started, go to python.org’s Windows download area and download the relevant installation. I’ll use the Windows x86-64 executable installation since it’ll be the most convenient.
Simply run the installer after downloading it, select Install, wait a few moments, and you’re done.
As you can see, installing Python on any platform is simple if you use one of the packages available for Linux/MacOS. Installing Python is simple, but learning to use it and getting acclimated to how things operate in Python is a whole other story! Keep an eye out for updates.