• Home
  • Windows
    • Windows 10
    • Windows 11
  • Mac
  • iOS
  • iPad
  • iPhone
  • Social Media
  • News
Sunday, May 28, 2023
HowToFixIssue
  • Home
  • Windows
    • Windows 10
    • Windows 11
  • Mac
  • iOS
  • iPad
  • iPhone
  • Social Media
  • News
No Result
View All Result
  • Home
  • Windows
    • Windows 10
    • Windows 11
  • Mac
  • iOS
  • iPad
  • iPhone
  • Social Media
  • News
No Result
View All Result
HowToFixIssue
No Result
View All Result
Home How To

How do I Install Python in Ubuntu Linux (4 Methods) (4 Methods)

February 3, 2023
in How To
Reading Time: 11 mins read

InterestingPosts

How to Tame a Cat in Minecraft Bedrock and Java Edition (2022)

How to Make a Stonecutter in Minecraft (2022)

Roblox Login: How to Recover Lost Password (2022)

How do I Install Python in Ubuntu Linux (4 Methods) (4 Methods).

Generally, Python comes pre-installed in Ubuntu, but when it’s not accessible in your Linux distro for some purpose, you possibly can set up Python in Ubuntu in a couple of steps. If you’re a developer, Python is crucial to construct varied software program and web sites. Other than that, a number of Ubuntu’s software program depends on Python, so you need to have it for the graceful functioning of the OS. On that observe, let’s go forward and discover ways to set up Python in Ubuntu.

Install Python in Ubuntu (2022)

In this tutorial, we’ve included 3 ways to get Python on Ubuntu. But earlier than that, let’s test if Python is already put in in your system and update it accordingly.

Note: We examined the instructions and strategies listed under on the most recent model, i.e. Ubuntu 22.04 LTS and Ubuntu 20.04.

Check If Python is Already Installed on Ubuntu

Before you put in Python in Ubuntu, it is best to test whether or not it’s already put in in your system. This permits you to update the present Python set up with out having to put in it from scratch once more. It must also turn out to be useful in the event you ever want to downgrade to a unique Python model. With that stated, listed below are the steps to comply with.

1. First, open Terminal using the “Alt + Ctrl + T” keyboard shortcut and run the under command. If the command provides an output with the model quantity, it means you have already got Python put in in Ubuntu. To exit Python’s surroundings, press “Ctrl + D”. In case you get an error message like “Command not found”, you don’t have Python put in. So transfer to the subsequent technique to put in it.

python3
Check If Python is Already Installed in Ubuntu

2. You may run the under command to test the Python model in your Ubuntu set up.

python3 --version
Check If Python is Already Installed in Ubuntu

3. If an older model of Python is put in, run the under command to update Python to the most recent model in your Linux distro.

sudo apt --only-upgrade set up python3
Check If Python is Already Installed in Ubuntu

Install Python in Ubuntu from Official Repository

Python is offered in Ubuntu’s official repository, so that you don’t should do a lot apart from execute a easy command to seamlessly set up it in your system. Here is how to do it.

1. Open Terminal in Ubuntu and run the under command to update all of the packages and repositories.

sudo apt update && sudo apt improve -y
Install Python in Ubuntu From Official Repository

2. Next, set up Python in Ubuntu by working the under command. This will robotically set up Python in your machine.

sudo apt set up python3
Install Python in Ubuntu From Official Repository

Install Python in Ubuntu from Deadsnakes PPA

Apart from the official repository, you can even pull newer variations of Python from Deadsnakes PPA, which is in style for internet hosting new and outdated variations of Python. If Ubuntu’s official repository (APT) was unable to put in Python in your system, this could definitely work. Here are the steps to comply with.

1. Fire up the Terminal using the “Alt + Ctrl + T” shortcut and run the under command. This is required to handle your distribution and software program sources from impartial distributors.

sudo apt set up software-properties-common
Deadsnakes PPA (Newer Versions)

2. Next, run the under command to add Deadsnakes PPA to Ubuntu’s repository. When prompted, press Enter to proceed.

sudo add-apt-repository ppa:deadsnakes/ppa
Deadsnakes PPA (Newer Versions)

3. Now, update the package deal record and run the subsequent command to set up Python.

sudo apt update
sudo apt set up python3
Deadsnakes PPA (Newer Versions)

4. You may select to set up a selected model (outdated or new) of Python from Deadsnakes PPA. It additionally hosts nightly builds of Python (experimental), so you possibly can set up them as effectively. Run the instructions within the following trend:

sudo apt set up python3.12

or

sudo apt set up python3.11
Deadsnakes PPA (Newer Versions)

Build Python in Ubuntu from the Source Code

If you want to go the additional mile and construct Python straight in Ubuntu from the supply code, you are able to do so. But keep in mind, it’s a barely lengthier course of and may require greater than quarter-hour to compile Python, relying in your {hardware} specs. Here are the steps that you must comply with.

1. First, open the Terminal and run the under command to update the packages.

sudo apt update
Build Python in Ubuntu From Source Code

2. After that, run the subsequent command to put in the required dependencies to construct Python in Ubuntu.

sudo apt set up build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget
Build Python in Ubuntu From Source Code

3. Next, create a “python” folder and transfer to the stated folder. If you get a “Permission denied” error, run the command with sudo.

sudo mkdir /python && cd /python
Build Python in Ubuntu From Source Code

4. Following that, use wget to obtain the most recent model of Python from the official web site. Here, I’m downloading Python 3.12.0a1.

sudo wget https://www.python.org/ftp/python/3.12.0/Python-3.12.0a1.tgz
Build Python in Ubuntu From Source Code

5. Now, extract the downloaded file using the tar command and transfer to the extracted folder.

sudo tar -xvf Python-3.12.0a1.tgz
cd Python-3.12.0a1
  • Build Python in Ubuntu From Source Code
  • Build Python in Ubuntu From Source Code

6. After that, run the under command to activate optimizations earlier than constructing Python in Ubuntu. This will scale back the time for Python compilation.

./configure --enable-optimizations
Build Python in Ubuntu From Source Code

7. Finally, execute the under command to construct Python in Ubuntu. This will take anyplace between 10 to fifteen minutes to finish the method.

sudo make set up
Build Python in Ubuntu From Source Code

8. Once it’s finished, run the python3 --version command to test the Python model quantity. And you’re finished.

Build Python in Ubuntu From Source Code

Install or Update Python in Ubuntu in 4 Easy Ways

So that is how one can set up Python in Ubuntu Linux. If you didn’t select a minimal setup throughout set up, then you definately seemingly have Python put in in your system. Then, you solely have to test the model and update the present Python set up. However, in the event you don’t have Python put in, you possibly can comply with one of many three strategies described above to put in it instantly. Anyway, that’s all from us. If you need to run Android apps in Linux with out an emulator, comply with our information for detailed directions. Finally, in case you have any questions, tell us within the remark part under.


Check out more article on –
How-To tutorial and latest highlights on – Technical News


Tags: Fix IssueFix Software IssuesFix Technical IssuesHow To FixHow To Fix IssueHow-To-9-How-ToInstallLinuxMethodsPythonUbuntu

Recommended.

Best Platformer Games

Best Platformer Games

December 23, 2022
How To Connect Bluetooth Speaker To PS4 Or PS5

How To Connect Bluetooth Speaker To PS4 Or PS5

March 12, 2023

Trending.

No Content Available
  • About
  • Advertise
  • Privacy & Policy
  • Contact
All about technical, android, mobile, windows relating website. We provide you with the latest technology straight from the industry.

© 2023 How To Fix Issue - All rights reserved.

No Result
View All Result
  • Home
  • Windows
    • Windows 10
    • Windows 11
  • Mac
  • iOS
  • iPad
  • iPhone
  • Social Media
  • News

© 2023 How To Fix Issue - All rights reserved.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
SAVE & ACCEPT
This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.