Jump to content

How to Install Python in Ubuntu - Other Helpful Tutorials - InviteHawk - The #1 Trusted Source for Free Tracker Invites

Buy, Sell, Trade, or Find Free Invites for top private trackers like redacted, blutopia, losslessclub, femdomcult, filelist, Chdbits, Uhdbits, empornium, iptorrents, hdbits, gazellegames, animebytes, privatehd, myspleen, torrentleech, morethantv, bibliotik, alpharatio, blady, passthepopcorn, brokenstones, pornbay, cgpeers, cinemageddon, broadcasthenet, learnbits, torrentseeds, beyondhd, cinemaz, u2.dmhy, Karagarga, PTerclub, Nyaa.si, Polishtracker, and many more.

Recommended Posts


  • Member ID:  53,629
  • Followers:  0
  • Topic Count:  3,075
  • Topics Per Day:  1.55
  • Content Count:  3,094
  • Content Per Day:  1.56
  • Reputation:   105
  • Achievement Points:  4,020
  • Days Won:  0
  • Joined:  01/24/2021
  • Status:  Offline
  • Last Seen:  

Almost every Linux distribution comes with a version of Python included in the default system packages. But on occasion, due to some reasons, you might not find Python installed on an Ubuntu system.

Let's take a closer look at how you can install Python on Ubuntu, with a brief guide on updating the Python package as well.

How to Check If Python Is Installed on Your System

Python is a powerful, high-level scripting language that is used by many developers around the globe. The language is ideal for a variety of real-world applications including web development, web scraping, and penetration testing. You can even build a Telegram bot using Python.

To check if Python is installed on your system or not, open up your terminal by pressing Ctrl + Alt + T. Type in "python" and press Enter.

If you see the following output in your terminal, then you have Python installed on your computer.

Python 3.9.1 (default, Dec 13 2020, 11:55:53) [GCC 10.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>>

This output provides information on the version of Python your system is running along with the current date and time.

On the other hand, if you see an error that states "bash: python: command not found", then sadly your Ubuntu system doesn't have Python installed.

You can also check for the Python version by simply typing the following command in your terminal.

python --version

The output will give you details on which version of Python is installed on your computer.

How to Install Python on Ubuntu

Installing Python on a Linux-based operating system is easy. You can get the latest version of Python on your Ubuntu machine from multiple sources. Here are some of the recommended ways to do the same.

Install Python Using Apt

Apt, or Advanced Package Tool is the default package manager that you will find on Ubuntu. You can download the Python package from the official Ubuntu repository. Here's how to do it.

Open up your terminal by pressing Ctrl + Alt + T.

Update your local system's repository list by entering the following command:

sudo apt-get update

Download the latest version of Python:

sudo apt-get install python

Apt will automatically find the package and install it on your computer.

Use Deadsnakes PPA to Install Python 3 on Ubuntu

If for some reason, you are unable to download the Python package from the official Ubuntu repository, you can try adding the Deadsnakes PPA to your system repository list. PPAs or Personal Package Archives are repositories that are specially designed for Ubuntu users.

By default, you can't add PPAs to your system's package lists. The "software-properties-common" package provides you an efficient way to manage and add PPAs to your system.

Install the above-mentioned package on your system by typing in the following command:

sudo apt-get install software-properties-common

Add the official Deadsnakes PPA link to your system's repository list:

sudo add-apt-repository ppa:deadsnakes/ppa

Update your system's package lists:

sudo apt-get update

Download the latest version of Python from the added PPA:

sudo apt-get install python3

Since the Deadsnakes PPA has almost every version of Python in its database, you can install older versions of Python as well. Just replace the package name with the version of python you want to install on your computer.

sudo apt-get install python3.2 sudo apt-get install python3.3 sudo apt-get install python3.8

Install Python 3 on Ubuntu From Source Code

You can also download and build the latest version of Python from the official Python website. Although compiling the source code might seem a bit daunting to you at first, it'll become easier once you know the process.

Update your system's local repository list:

sudo apt-get update

Install supporting dependencies on your system with Apt:

sudo apt-get install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget

Make a new directory to store the Python source files:

mkdir /python && cd /python

Download the Python source code from the official FTP server:

wget https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz

Extract the TGZ file that you just downloaded:

tar –xf Python-3.9.1.tgz

You need to perform tests and optimizations before installing Python. This is important as it increases the execution of your code by 10-20 percent:

cd python-3.9.1 ./configure --enable-optimizations

Build the package using the MakeFile present in the directory:

sudo make install

After you've implemented these steps, check if Python has been installed on your computer by typing python --version in your terminal.

Note that Python modules are managed through PIP. PIP is a package management system that is used to download and add libraries from the Python Package Index. Installing Python PIP on your system is important if you want to use modules on your Python project.

Updating Python to the Latest Version

First of all, make sure that you have an outdated version of Python installed on your system. You can do this by entering python --version in your terminal. Note down the version details.

You can find out what's the latest version available by searching the internet. A quick Google search on "python latest version" would suffice. If the two version numbers don't match, then you are probably running an outdated version.

Upgrading to the latest version is easy with Ubuntu's Advanced Package Tool. If you have installed Python on your system using Apt or the Deadsnakes PPA, enter the following command to download the latest version of Python:

sudo apt-get install python

You can also use the --only-upgrade flag to update your packages.

sudo apt-get --only-upgrade install python

For those who have compiled the source code on their own, you can head over to the Python FTP and grab a copy of the latest version. You will have to follow the steps all over again, however.

Running Python on Ubuntu

Python comes preinstalled on almost every Linux system and is available on official distribution repositories as well. If you still don't get Python installed on your computer, then you can easily download it using Ubuntu's package manager.

The Python language is used in a variety of different sectors, and its applications are enough to demonstrate how powerful it is. Programming languages have become important as because of the growing demand for developers across industry.

Link to comment
https://www.invitehawk.com/topic/154287-how-to-install-python-in-ubuntu/
Share on other sites


  • Member ID:  48,211
  • Followers:  60
  • Topic Count:  144
  • Topics Per Day:  0.06
  • Content Count:  30,040
  • Content Per Day:  13.21
  • Reputation:   2,202
  • Achievement Points:  38,182
  • Days Won:  11
  • Joined:  04/09/2020
  • Status:  Offline
  • Last Seen:  

Avoid unnecessary posts such as 'Thank you', 'Welcome', etc. Such posts will be deleted and user will be warned if it happens again. If caught spamming, the following actions are applicable -

  • First time - Warning
  • Second time - 5000 Points will be deducted
  • Third time - Ban for 7 days
  • Fourth time - Permanent Ban

If the post helped you, reward the user by reacting to the post like this -

1.jpg

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Read this before posting -
  • Only post if you have something valuable to contribute.
  • Avoid unnecessary posts such as 'Thank you', 'Welcome', etc. Such posts will be deleted and you will be warned if it happens again.
  • If the post helped you, reward the user by reacting to the post like this -                      1.jpg
Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Customer Reviews

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.