Install Python 3 in Windows 10/11 or Ubuntu Easily
If you landed here, you probably want to install Python 3 on your Windows 10/11 or Ubuntu system.
Hey there! You are here to install Python 3 on your system, so I assume you are familiar with what is Python and why you need it. If you are not familiar with Python, you can read the article Why to learn Python 3 in 2022 ? to get started.
If you are interested in watching a video tutorial in Hindi, you can watch it here.
This article is divided into two parts:
Windows Installation
Prerequisites
- First, you will need to check if you have already Python 3 installed on your system.
- Run this command to check if you have Python 3 installed on your system:
-
If this command returns a string like
Python 3.8.5
or any other version, you already have Python 3 installed on your system. -
If this returns nothing or gives some error like Python not found, you can continue with the installation.
Installation
-
Visit Python.org, and here you will find the latest version of Python 3 and a yellow download button.
-
Installing a specific version of Python 3
- If you want to install a specific version of Python 3, you can scroll down on the Python page until you find Looking for a specific release?.
- Click the download button in front of the specific version you want to install.
- Scroll down to the
Files
section. Here are multiple installers for Python 3. - If your system is 64-bit (check using
wmic os get osarchitecture
command), you will find aWindows Installer (64 bit)
installer. (Or use the 32-bit version if required).
-
Whichever version you choose, you will get a windows installer file. Double click to open it. You will need admin privileges on your system.
-
You will see a window like this:
-
Make sure to check the
Add Python to PATH
checkbox. This is important because we want to be able to run Python 3 from anywhere on our system. -
Now click
Install Now
button. Accept any prompts and wait for the installation to complete. -
Once the installation is complete, close the window.
-
If everything went well, try running the following command to check if Python 3 is successfully installed on your system:
-
If it returns the version of Python you just installed, you have successfully installed Python 3 on your system.
Ubuntu Installation
Prerequisites
- If you are using Ubuntu, there are high chances that you have Python 3 already installed on your system as some libraries require it from the Ubuntu operating system.
One thing to note is that generally, Ubuntu has two versions of Python installed, which are
Python 2.x
andPython 3.x
. if you run any command using thepython
, it will run the version of Python 2.x. If you want to run Python 3.x, you need to use thepython3
command instead.
- You can check if Python 3 is installed on your system by running the following command:
-
If this returns a string like Python 3.7.3 or any other version, you already have Python 3 installed on your system.
-
If this returns nothing or gives some error like Python not found, you can continue with the installation.
-
Run these commands to install Python 3 on your system:
- This will install Python 3 on your system. You can check if it is installed correctly by running the following command:
-
Python also has a package manager called
pip
which is used to install Python packages. -
Check if pip is installed by running the following command:
Be aware that by default,
pip
will use Python 2.x andpip3
will use Python 3.x.
-
If it says
pip3
is not found, then you need to install it. -
Run the following command to install pip:
- This completes the installation of Python 3 on your system.
Additional Resources
-
If you use Visual Studio Code to code, you can install this Python 3 extension from Visual Studio Code Marketplace to simplify Python development.
-
If, for any reason, you are not able to install Python 3 on your system, you can use online services like OnlineGDB.com to code Python in your browser without the need to install Python 3 on your system. You can use this method on any device like android or ios also.
-
There are multiple apps you can install for Android and IOS to run Python 3. Just search for
Python 3
in the Google Play Store or App Store.
Conclusion
Now you have successfully installed Python 3 on your system. You can now start coding in Python 3.
Thank you so much for taking the time to read this.