Introduction to Linux System
Before we go to the python installation tutorial, it is important to have an understanding of the Linux operating system. Like every other operating system, Linux is an interface provider, but unlike other operating systems, it has various advantages that make Linux a top priority in almost all technological fields. Some of its advantages are,
- Open-source operating system free of cost
- It is secure compared to other OS.
- It is faster and compatible; it can handle any file formats.
- Linux has various distribution systems such as Arch Linux, Ubuntu, Fedora, Kubuntu etc.
- Linux can be easily customized to our preferences.
So even in the Data science world, people are preferring Linux operating systems because of their advantages.
Python on Linux
Below are the details of Python on Linux:
Python is a powerful and popular programming language. It can be installed on various versions of the Linux operating system. Some Linux version that has an RPM Package Manager such as, CentOS, Fedora has Python pre-installed, and we can check it by typing the following code in the command prompt:
Python - - version
If the following code gives an error, we can assume that python is not pre-installed. Even if python pe-installed we can update the version for using Interactive Environment (IDLE). Python installation requires a python interpreter, which can be obtained from Python Software Foundation (https://www.python.org/) for installing in other operating systems, and for Linux, a package manager is used for installing python.
Installing Python on Linux system
Following are the steps to follow:
Step 1: Go to the Python site through your browser and navigate to the download page. (https://www.python.org/downloads/). From various other operating systems given, we need to select the Linux/UNIX option.
Step 2: Now, a web page consists of different releases of the python versions. We need to choose a link that is required for our version of Linux from the different releases.
Step 3: After clicking on the desired link, we will get a pop-up window for opening or saving the python download file; click on the Save option. This would let the Python source files to start downloading.
Step 4: After the file is downloaded, open the zipper downloaded file. Extract the files to a specific Python folder. Click on the Python folder, and the Archive Manager will begin extracting the downloaded files in the Python subfolder.
Step 5: Now, a Terminal window is opened and to proceed with the installation, build-essentials must be installed in our systems, such as SQLite or bzip2.
Step 6: In the terminal, type in and Enter the code.
sudo apt-get install build-essential
- Linux installs the Build Essential that is required to build the packages.
Step 7: In the terminal, we need to type in and Enter the following code.
sudo apt-get install libsqlite3-dev
- After the code is run, Linux will install the SQLite support required by Python for database management.
Step 8: After SQLite installation, we need to install bzip2 that is required for the archive manipulation type and Enter the following command:
sudo apt-get install libbz2-dev
Linux installs the bzip2 support required by Python.
Step 9: After the bzip installation type and enter CD Python <version> in the Terminal window. The terminal will change the directories to the Python 3.3.4 folder on our system.
Step 10: Once the directories are changed, we need to configure the system to verify the system-built type. To perform this task, type and Enter the following code,
Step 11: As soon as this task is performed, type in and Enter.
- After pressing Enter, the python application software is created. This application software is creation takes time depending on the speed of our system.
Step 12: At this stage, the installation is almost done, and we need to give the administrator password to finish the process for that type in the following code and press Enter.
sudo make altinstall
Step 13: After typing and Entering the code, python will be installed in our system. Check the version by typing the “python – – version” code and check the particular version has installed. Now we can perform python programming in our Linux system.
Even though python works in various environments, Linux operating system always has the edge over other operating systems. It is stable compared to windows, especially when we are using large bits of data, and even in the deployment process, the environments are mostly Linux. So, it is always better to practice python programming in the Linux environment.
This is a guide to Install Python on Linux. Here we discuss the introduction to Linux system, Python in Linux in detail and, Installing Python on Linux. You can also go through our other related articles to learn more-