Site icon TestingDocs.com

Install Python on Ubuntu Linux

Install Python on Ubuntu Linux

Let’s learn the steps to install Python on Ubuntu Linux. Ubuntu is a popular open-source operating system based on Linux. It’s known for its user-friendly interface and versatility, making it a great choice for Linux beginners.

Install Python on Ubuntu

Open a web browser and navigate to the following URL:

https://www.python.org/downloads

Download the Python Source Releases tarball. Follow the link to download the zipped source code for Unix/Linux.

For example, the sample filename would be: Python-<version>.tgz

 

Download and extract files. Open the terminal window and change the directory to the downloaded directory.

$ tar -xvf <python_tar_ball>

 

You can customize the options by editing the modules and the setup file. If your platform’s binary code is unavailable, you need a C compiler to compile the source code manually. Install the C compiler with the following command:

$ sudo apt install gcc

 

Run the following script:

$ ./configure

Issue the following command:

$ make

The make command in Linux compiles source code into executable programs or libraries. It reads the instructions in a Makefile file and builds the software.

$ make install

The make install command is used after compiling the source code to install the compiled program or library onto the system. This command copies the necessary files to the appropriate directories to use system-wide software.

This will install Python in a standard location

/usr/local/bin

The Python libraries will be at:

/usr/local/lib/python<version>

where <version> is the version of Python.

That’s it. Python is successfully installed on the machine. Check the installation by issuing the following command:

$ python3 –version

Related:

Install Python on Windows: click here

Python Tutorials

Python Tutorial on this website can be found at:

https://www.testingdocs.com/python-tutorials/

More information on Python is available at the official website:

https://www.python.org

Exit mobile version