Installing python3 is the first step to becoming a python developer, This tutorial will help you install python3 as well as pip3 to install python packages on your local system with the latest and most stable way possible.

Table of Contents

Install Python3 in Ubuntu

Open your terminal (Ctrl + Alt + T), if this command does not work then open it manually by searching the terminal.

Update your local system repository list

sudo apt update

Install software-properties-common to add PPA (Personal Package Archive)

sudo apt install software-properties-common

Now add Deadsnakes PPA. Deadsnakes is a PPA with newer releases than Ubuntu's default repositories

sudo add-apt-repository ppa:deadsnakes/ppa

Update your local system repository list again

sudo apt update

Download the latest version of python3

sudo apt install python3

To install any other version, you can modify the above command like this

sudo apt install python3.8

Now check your python version

python3 -V

You should see your python version installed like this

Python 3.8.10 #it may vary as per your installation

Now install pip3

sudo apt install python3-pip

That's it [OPTIONAL] It is good practice to work with virtual environment

Install Python3 in macOS

Download the required macOS installer from the python.org official website, and select the Download Python3.x button.

Locate the file using Finder, and double-click the package file. Following the installation prompts.

You can now confirm successful installation by checking for the Python 3 as shown below

python3 -V # Output Python 3.7.2

You can similarly check that pip3 is installed by listing the available packages:

pip3 list

Install Python3 in Windows

Windows 10 users

Microsoft has a python application available in the Microsoft Store and it is also the recommended way of installing python. It handles auto-updates and PATH variable issues.

To install Open microsoft store and search python.

Click on the GET button. Once downloaded and installed, click on the ... and select **pin to taskbar.

Now, click on the pinned python logo on the taskbar. This will launch Python IDLE. Now you can run python programs.

python-microsoft-store-min

Windows 7, 8 Users

Download the required installer from python official website, and select Download Python 3.x button

python-download-min

Locate the file using Finder, and double-click the package file. Following the installation prompts and instructions.

Be sure to check the box labeled "Add Python to PATH"

Now, open `PowerShell in Windows.

Confirm successful installation by checking for the Python 3 as shown below:

py -3 -V # Output Python 3.7.2

The Windows installer incorporates pip3 (the Python package manager) by default. You can list installed packages as shown

pip3 list

Note: The installer should set up everything you need for the above command to work. If however, you get a message that Python cannot be found, you may have forgotten to add it to your system path. You can do this by running the installer again, selecting "Modify", and checking the box labeled "Add Python to environment variables" on the second page.

If the problem still persists, set your python path in windows manually

Fixing Windows Python Path Not Found

  • Right-click on This PC and click on properties
  • Next, click on the Advanced system settings
  • Finally, click on the ‘Environment variables…
  • That should take you to the Environment Variables screen, where you can add new paths.
  • Click on ‘New…‘ which is located under the User variables box.
  • You should then see a dialog box, which will allow you to add new variables.
  • Before you type any values, you’ll need to locate the relevant Python paths. The paths that you’ll need to get are:
  • The Python application path, which is the folder where you originally installed Python; and
  • The Python Scripts path. The Scripts folder should be located within the Python application path.
  • Now let’s fill the New User Variable box that you saw earlier:
  • For the Variable name, you may type a name, such as ‘Path’ for example.
  • For the Variable value, copy the full Python application path, then use a semicolon (as highlighted in yellow below), and finally copy the Python Scripts path.
  • This is what my Variable value would look like:
  • C:\Users\Nitin\AppData\Local\Programs\Python\Python37-32;C:\Users\Nitin\AppData\Local\Programs\Python\Python37-32\Scripts
  • Press ‘OK’ and you would then see your new Python Path under the ‘User variables' section. Don’t forget to press ‘OK’ again so that the changes will get implemented.

That’s it! You just added Python to the Windows Path.