Installing Python
For working in Python, we must first have to install it. You can perform the installation of Python in any of the following two ways −
Installing Python individually
Using Pre-packaged Python distribution − Anaconda
Let us discuss these each in detail.
Installing Python Individually
If you want to install Python on your computer, then then you need to download only the binary code applicable for your platform. Python distribution is available for Windows, Linux and Mac platforms.
The following is a quick overview of installing Python on the above-mentioned platforms −
On Unix and Linux platform
With the help of following steps, we can install Python on Unix and Linux platform −
-
First, go to www.python.org/downloads/.
-
Next, click on the link to download zipped source code available for Unix/Linux.
-
Now, Download and extract files.
-
Next, we can edit the Modules/Setup file if we want to customize some options.
-
Next, write the command run ./configure script
-
make
-
make install
On Windows platform
With the help of following steps, we can install Python on Windows platform −
-
First, go to www.python.org/downloads/.
-
Next, click on the link for Windows installer python-XYZ.msi file. Here XYZ is the version we wish to install.
-
Now, we must run the file that is downloaded. It will take us to the Python install wizard, which is easy to use. Now, accept the default settings and wait until the install is finished.
On Macintosh platform
For Mac OS X, Homebrew, a great and easy to use package installer is recommended to install Python 3. In case if you don't have Homebrew, you can install it with the help of following command −
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
It can be updated with the command below −
$ brew update
Now, to install Python3 on your system, we need to run the following command −
$ brew install python3