SlideShare a Scribd company logo
How to Install Python on Linux
Python is one of the oldest programming languages around. However, with the onset of Machine
Learning, Python has been given a new lease of life. It has become a popular tool for both Machine
Learning and Deep Learning.
Currently, Python is available as two distinct versions. That is Python 2 and Python 3.
Ubuntu comes with Python pre-installed. So when you open the terminal and enter python at the
command prompt, Python should start. You will see the version of Python that is currently on your
system.
To upgrade to the latest version of Python, exit the python shell by typing exit()
Now, enter the following command in the terminal:
sudo apt-get upgrade
This will upgrade all the software on your system.
If Python has not been installed on your system, you can follow the instructions below to install
Python.
Selecting a Version of Python
With two great choices, how do you decide on which one to use? It all comes down to
compatibility. Certain programmes or libraries that you want to use in your project may only be
compatible with one version of Python.
So keep your end goal in mind when selecting a version. If you want to have more flexibility when
it comes to Python projects, just download, both versions.
Begin Installation
Note: These steps can be followed to install both versions of Python.
1. Visit https://www.python.org/
2. Select the 'Downloads' tab. A drop down menu will appear.
3. To the right of the drop down menu, you will see the latest versions of python that are
available for Ubuntu. The first button provides the latest version of Python 3 and the second
button provides the option for the latest version of Python 2. Once you click an option, the
download will begin.
4. Once installation is complete, open the terminal and type cd Downloads/
5. You will enter the downloads folder. Now type the command ls.
6. This will let you view the contents of your Downloads folder and check to make sure that
the Python installer has been downloaded.
7. Now extract the contents of the Python installer by using the command tar xvf 
Python-3.6.4.tar.xz
8. Make sure to enter the correct version number, then type enter.
9. Now enter the extracted folder by typing the command cd Python-3.6.4/
10. Once you have entered the folder, use the command ./configure
11. This begins the installation process and will take a while depending on your system's
memory and speed.
12. Once it has completed, use the command sudo make
13. For security purposes, you will be asked to enter your password before proceeding. Enter
your password and hit the enter button.
14. The file takes a while to be created.
15. Once it has completed, type the command sudo make install
16. Once again this will take a few minutes.
17. Once the process is complete, you should get a message saying that al requirements are
satisfied. This means that you have successfully installed Python on your system.
Troubleshooting
1. You may get an error message saying that pip requires ssl.
2. To install ssl, us the command sudo apt-get install libssl-dev openssl
3. Once this is completed, use the command sudo make install
4. Python should now be successfully installed on your system.
Testing Your Installation
Now that you have downloaded Python, test it to make sure it is working correctly.
1. Open the Ubuntu Terminal.
2. Type python3 or python2 (depending on which version you would like to use) and press
enter.
3. The version of your Python installation should show up.
4. To test it further, run python by typing python and pressing enter.
5. Now type the command print("Hello World!") and press enter.
6. This will print the words Hello World in the terminal.
 
Congratulations! You have installed Python on your system.

More Related Content

Similar to How to Install Python on Linux (20)

PDF
How to Check and Update the Python Version on Ubuntu 2404.pdf
Green Webpage
 
PDF
Getting started with python
TechieHours
 
PPTX
L2 - Install Python.pptx
EloAOgardo
 
PDF
Python setup for dummies
Rajesh Rajamani
 
PPTX
Welcome_to_Python.pptx
21M220KARTHIKEYANC
 
PDF
Step-by-Step Instructions on How to Install Python 3
Hedaro
 
PDF
6_getting__started_with_python.pdf
maheshrawal2006
 
PPTX
How to setup Pycharm environment for Odoo 17.pptx
Celine George
 
PDF
python-handbook.pdf
RaviKumar76265
 
DOCX
Software Instructions
Anastasia Khudoyarova
 
PDF
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Niraj Bharambe
 
PDF
Getting started with python.pdf
AbhinavBawane
 
PDF
getting started with python6 (1).pdf
Suyashsingh992747
 
PDF
Get Started with MicroPython ESP32
fanghe22
 
PDF
Get Starte with MicroPython ESP32
fanghe22
 
PPTX
Python Programming-Lesson 1- Installation and Environmental Set-up.pptx
BautistaAljhonG
 
PDF
ppt about natural language toolkit in nlp
dikshasingh2515014ae
 
PDF
How to Install Python 2 on Ubuntu 2404 3 Quick Methods.pdf
Green Webpage
 
PPTX
Intro to Programming Week 2_Python Installation.pptx
iksanbukhori
 
PPTX
chapter-1-eng-getting-started-with-python.pptx
Jahnavi113937
 
How to Check and Update the Python Version on Ubuntu 2404.pdf
Green Webpage
 
Getting started with python
TechieHours
 
L2 - Install Python.pptx
EloAOgardo
 
Python setup for dummies
Rajesh Rajamani
 
Welcome_to_Python.pptx
21M220KARTHIKEYANC
 
Step-by-Step Instructions on How to Install Python 3
Hedaro
 
6_getting__started_with_python.pdf
maheshrawal2006
 
How to setup Pycharm environment for Odoo 17.pptx
Celine George
 
python-handbook.pdf
RaviKumar76265
 
Software Instructions
Anastasia Khudoyarova
 
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Niraj Bharambe
 
Getting started with python.pdf
AbhinavBawane
 
getting started with python6 (1).pdf
Suyashsingh992747
 
Get Started with MicroPython ESP32
fanghe22
 
Get Starte with MicroPython ESP32
fanghe22
 
Python Programming-Lesson 1- Installation and Environmental Set-up.pptx
BautistaAljhonG
 
ppt about natural language toolkit in nlp
dikshasingh2515014ae
 
How to Install Python 2 on Ubuntu 2404 3 Quick Methods.pdf
Green Webpage
 
Intro to Programming Week 2_Python Installation.pptx
iksanbukhori
 
chapter-1-eng-getting-started-with-python.pptx
Jahnavi113937
 

More from Vinita Silaparasetty (9)

PDF
R Upgrade Instructions
Vinita Silaparasetty
 
PDF
Installation instructions for R
Vinita Silaparasetty
 
PDF
Reshape2 Installation Instructions
Vinita Silaparasetty
 
PDF
Dplyr Installation Instructions
Vinita Silaparasetty
 
PDF
Ggplot2 Installation Instructions
Vinita Silaparasetty
 
PDF
GPS Handbag
Vinita Silaparasetty
 
PDF
Motion Sensing Couture
Vinita Silaparasetty
 
PPTX
What is Jupyter Notebook?
Vinita Silaparasetty
 
R Upgrade Instructions
Vinita Silaparasetty
 
Installation instructions for R
Vinita Silaparasetty
 
Reshape2 Installation Instructions
Vinita Silaparasetty
 
Dplyr Installation Instructions
Vinita Silaparasetty
 
Ggplot2 Installation Instructions
Vinita Silaparasetty
 
Motion Sensing Couture
Vinita Silaparasetty
 
What is Jupyter Notebook?
Vinita Silaparasetty
 
Ad

Recently uploaded (20)

PDF
apidays Singapore 2025 - Surviving an interconnected world with API governanc...
apidays
 
PDF
Driving Employee Engagement in a Hybrid World.pdf
Mia scott
 
PDF
apidays Singapore 2025 - From API Intelligence to API Governance by Harsha Ch...
apidays
 
PDF
Data Retrieval and Preparation Business Analytics.pdf
kayserrakib80
 
PPTX
apidays Helsinki & North 2025 - Agentic AI: A Friend or Foe?, Merja Kajava (A...
apidays
 
PPTX
Numbers of a nation: how we estimate population statistics | Accessible slides
Office for National Statistics
 
PDF
The Best NVIDIA GPUs for LLM Inference in 2025.pdf
Tamanna36
 
PDF
The European Business Wallet: Why It Matters and How It Powers the EUDI Ecosy...
Lal Chandran
 
PDF
Optimizing Large Language Models with vLLM and Related Tools.pdf
Tamanna36
 
PDF
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
PPTX
Listify-Intelligent-Voice-to-Catalog-Agent.pptx
nareshkottees
 
PDF
Development and validation of the Japanese version of the Organizational Matt...
Yoga Tokuyoshi
 
PDF
apidays Helsinki & North 2025 - How (not) to run a Graphql Stewardship Group,...
apidays
 
PDF
A GraphRAG approach for Energy Efficiency Q&A
Marco Brambilla
 
PPTX
SlideEgg_501298-Agentic AI.pptx agentic ai
530BYManoj
 
PPT
tuberculosiship-2106031cyyfuftufufufivifviviv
AkshaiRam
 
PPTX
apidays Singapore 2025 - The Quest for the Greenest LLM , Jean Philippe Ehre...
apidays
 
PPTX
apidays Singapore 2025 - Designing for Change, Julie Schiller (Google)
apidays
 
PPTX
b6057ea5-8e8c-4415-90c0-ed8e9666ffcd.pptx
Anees487379
 
PDF
apidays Helsinki & North 2025 - API-Powered Journeys: Mobility in an API-Driv...
apidays
 
apidays Singapore 2025 - Surviving an interconnected world with API governanc...
apidays
 
Driving Employee Engagement in a Hybrid World.pdf
Mia scott
 
apidays Singapore 2025 - From API Intelligence to API Governance by Harsha Ch...
apidays
 
Data Retrieval and Preparation Business Analytics.pdf
kayserrakib80
 
apidays Helsinki & North 2025 - Agentic AI: A Friend or Foe?, Merja Kajava (A...
apidays
 
Numbers of a nation: how we estimate population statistics | Accessible slides
Office for National Statistics
 
The Best NVIDIA GPUs for LLM Inference in 2025.pdf
Tamanna36
 
The European Business Wallet: Why It Matters and How It Powers the EUDI Ecosy...
Lal Chandran
 
Optimizing Large Language Models with vLLM and Related Tools.pdf
Tamanna36
 
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
Listify-Intelligent-Voice-to-Catalog-Agent.pptx
nareshkottees
 
Development and validation of the Japanese version of the Organizational Matt...
Yoga Tokuyoshi
 
apidays Helsinki & North 2025 - How (not) to run a Graphql Stewardship Group,...
apidays
 
A GraphRAG approach for Energy Efficiency Q&A
Marco Brambilla
 
SlideEgg_501298-Agentic AI.pptx agentic ai
530BYManoj
 
tuberculosiship-2106031cyyfuftufufufivifviviv
AkshaiRam
 
apidays Singapore 2025 - The Quest for the Greenest LLM , Jean Philippe Ehre...
apidays
 
apidays Singapore 2025 - Designing for Change, Julie Schiller (Google)
apidays
 
b6057ea5-8e8c-4415-90c0-ed8e9666ffcd.pptx
Anees487379
 
apidays Helsinki & North 2025 - API-Powered Journeys: Mobility in an API-Driv...
apidays
 
Ad

How to Install Python on Linux

  • 1. How to Install Python on Linux Python is one of the oldest programming languages around. However, with the onset of Machine Learning, Python has been given a new lease of life. It has become a popular tool for both Machine Learning and Deep Learning. Currently, Python is available as two distinct versions. That is Python 2 and Python 3. Ubuntu comes with Python pre-installed. So when you open the terminal and enter python at the command prompt, Python should start. You will see the version of Python that is currently on your system. To upgrade to the latest version of Python, exit the python shell by typing exit() Now, enter the following command in the terminal: sudo apt-get upgrade This will upgrade all the software on your system. If Python has not been installed on your system, you can follow the instructions below to install Python. Selecting a Version of Python With two great choices, how do you decide on which one to use? It all comes down to compatibility. Certain programmes or libraries that you want to use in your project may only be compatible with one version of Python. So keep your end goal in mind when selecting a version. If you want to have more flexibility when it comes to Python projects, just download, both versions. Begin Installation Note: These steps can be followed to install both versions of Python. 1. Visit https://www.python.org/ 2. Select the 'Downloads' tab. A drop down menu will appear. 3. To the right of the drop down menu, you will see the latest versions of python that are available for Ubuntu. The first button provides the latest version of Python 3 and the second button provides the option for the latest version of Python 2. Once you click an option, the download will begin. 4. Once installation is complete, open the terminal and type cd Downloads/ 5. You will enter the downloads folder. Now type the command ls. 6. This will let you view the contents of your Downloads folder and check to make sure that the Python installer has been downloaded. 7. Now extract the contents of the Python installer by using the command tar xvf  Python-3.6.4.tar.xz 8. Make sure to enter the correct version number, then type enter.
  • 2. 9. Now enter the extracted folder by typing the command cd Python-3.6.4/ 10. Once you have entered the folder, use the command ./configure 11. This begins the installation process and will take a while depending on your system's memory and speed. 12. Once it has completed, use the command sudo make 13. For security purposes, you will be asked to enter your password before proceeding. Enter your password and hit the enter button. 14. The file takes a while to be created. 15. Once it has completed, type the command sudo make install 16. Once again this will take a few minutes. 17. Once the process is complete, you should get a message saying that al requirements are satisfied. This means that you have successfully installed Python on your system. Troubleshooting 1. You may get an error message saying that pip requires ssl. 2. To install ssl, us the command sudo apt-get install libssl-dev openssl 3. Once this is completed, use the command sudo make install 4. Python should now be successfully installed on your system. Testing Your Installation Now that you have downloaded Python, test it to make sure it is working correctly. 1. Open the Ubuntu Terminal. 2. Type python3 or python2 (depending on which version you would like to use) and press enter. 3. The version of your Python installation should show up. 4. To test it further, run python by typing python and pressing enter. 5. Now type the command print("Hello World!") and press enter. 6. This will print the words Hello World in the terminal.   Congratulations! You have installed Python on your system.