Python Installation: How To Download, Setup & Install Python

  1. Home
  2. Technical Tutoring Tips
  3. Python Installation: How To Download, Setup & Install Python

Subject: Computer Science - Other

Field: Computer Science

Written by: duova

duova

Completed: 3,529
Computer Science Requests: 2,938


Python Installation: How To Download, Setup & Install Python

Guido Van Rossum first started Python as a hobby project and named it humorously after the British comedy troupe Monty Python. However, over time it developed into one of the most popular programming languages to date and is used for various things.

In fact, according to a 2020 developer survey, Python is among the top five most popular programming languages and development tools, and it doesn’t show any signs of losing its popularity. If you want to get into this programming language but don’t know a lot about it, you’ve come to the right place.

Python use cases

Before you learn how to install Python, you should first know why you would want to do it. The list of Python software is vast, including software packages like video games all the way up to mathematical libraries, with almost anything in between.

Let’s take a look at some of the most popular Python use cases.

Machine learning and AI

Python is a fairly simple programming environment when compared to some other languages. It’s both stable and flexible, which makes it ideal for projects that include machine learning and artificial intelligence.

Web development

The back end of an application or a website, the parts that end users don’t see, are often developed using Python. This programming language plays an important part in web development such as enhancing security, sending data to and from servers, and URL routing.

Software testing

While developing software, programmers often use Python to track bugs, build control, and perform tests. With Python, developers can completely automate the testing process of a new feature or product.

Data analytics and visualization

Since people and businesses are collecting and creating more data than ever, it’s important to have a program that can collect, organize, and manipulate all of that information. And Python is great for that.

Additionally, you can use Python for data visualization and create graphical representations or interactive plots of the data you need. All you need to do is find the right standard library that will fit your coding project.

Everyday tasks

Experienced developers aren’t the only people who can use Python. If you learn this programming language, you can simplify certain tasks in your life. For example, you can keep up with the stock market, convert text files into spreadsheets, send yourself text reminders, and more.

What are the most prominent Python features?

One of the reasons why Python programming is so popular is because it is a great development environment for programming and scientific computing, and it comes with a plethora of amazing features.

  • Simple to code and read. Even though it’s a high-level programming environment, Python is very easy to learn. In fact, most people can tackle the basics in a few days or even a few hours with the help of Python tutors. Since it looks like simple English, it’s also very straightforward to read.
  • Open-source and free to use. Regardless of if you’re using it for personal or commercial purposes, Python is free to download and use.
  • Extensive standard library. Not only is it free to use, but it also comes with a robust standard library, which means you don’t have to write your code for everything like you do with other programming languages. Instead, you simply need to look for a code in the standard library.
  • It’s interpreted. The source code for Python is executed line by line, which means you don’t have to complete your entire code to run it.
  • It’s portable. If you write your code on a Windows computer, for example, and want to run it on a Mac computer later, you’ll be able to do that without any issues.

How to install Python on Mac OS

If you’re wondering how to install Python on Mac OS, there are two ways you can go about it:

  • Use the official installer
  • Use the Homebrew package manager (a powerful package management system)

Let’s take a closer look at both of these methods.

Installing Python from the official installer

This is the more reliable method for installation. It comes with all of the system dependencies you will need to develop an application with Python.

The first step is to download the installer. To do this, you need to go to the Downloads dropdown menu on the python.org website and select macOS, and from there you can download the current version of the installation file. When you go to Python releases and find the latest stable release, you can see version-specific information.

While you’re there, scroll down until you see the version you need. The version for Mac OS should have “macOS” in the file description. Click on the download link and you will soon have the official installer in the installation location on your computer.

From there, you need to run the installer. Read the introduction and make sure you understand the important information and license before clicking on “next step”.

When you reach the agreement and conditions, click “agree” and Python will be ready for installation.

Installing Python from the HomeBrew package manager

The HomeBrew package manager is a great option for those who need to install Python from the command line window. You can download HomeBrew from https://brew.sh by clicking on the command titled “Install HomeBrew” and entering the following command:

/bin/bash -c "$(curl -fsSL

https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

When you paste the command, press the “Return” or “Enter” button. You also might need to input your Mac OS credentials. There is also a chance you will get a popup alert that will ask you to install Apple's command-line tools.

From there, you need to open the terminal window and write the command $ brew update && brew upgrade. This command will update HomeBrew and when the installation is complete, use the command brew install python3.

How to install Python on Linux

The first thing we’ll mention in this Python Linux installation guide is that you will need to install the development packages for building Python.

On Debian, it’s:

  • $ sudo apt update
  • $ sudo apt install build-essential zlib1g-dev \
  • libncurses5-dev libgdbm-dev libnss3-dev \
  • libssl-dev libreadline-dev libffi-dev curl

On Fedora, it’s:

  • $ sudo dnf groupinstall development

From there, you will need to download the most recent stable release of Python from their official website. While you can use previous versions, the most stable versions are usually the newest ones. Once that is done, you will have an archive file (also known as a tarball) with the Python source code.

When it downloads, extract this tarball either by using the Linux tar command ($ tar -xf Python-3.?.?.tar.xz) or an extractor application.

Once you’ve extracted the tarball, the next step is to navigate to the script, configure it, and execute it in your terminal window. You can do this by using the code:

$ cd Python-3.*

./configure

If your Linux computer already contains an older version of Python, you can use the command $ sudo make altinstall to install the newest version. However, it would be better to completely remove the old version from your computer and install the newest version as a package.

If you didn’t run into any errors during your setup process, your Linux computer should have the newest Python version installed onto it. The final step is to verify it, which you can do by writing the command python3 –version or python --version.

If you did all of the install steps correctly, your output should say “Python 3.x”, which will indicate that you managed to install Python 3 successfully.

It’s important to note that all of the installation steps we described will take some time to complete.

Keep in mind that one of the Python installation options on Linux is to install a virtual environment. Installing a virtual environment is the first choice of many people for installation.

How to install Python on Windows

Before we get into it, it’s important to mention that there are a few prerequisites you need to meet if you want to install Python:

  • Have a system that is running on at least Windows 7 or Windows 10 and have admin privileges.
  • A command prompt that comes pre-installed with all Windows systems.
  • Also, it’s good to know whether you have a 64-bit Windows version or a 32-bit version.

To perform this installation, you first need to make sure to download all relevant project files that are compatible with your version on Windows. As of writing this, the latest Python update is Python 3.10.5 for Python 3. It’s compatible with both Windows 7 and Windows 10, and the installation process is the same for both versions.

The first step is to go to the official Python website and select the version you want to install. There will be a lot to choose from, and you need to find a version that meets your needs. You can also choose a version based on the operating system you use.

Once you’ve made your decision, download the python.exe file which you will find in your Windows downloads section. Find Python 3.10.5 and download it with your Windows installer.

Once the download is complete, you need to go to your installation location and run the Python installer. Follow the installation steps in the setup process and don’t forget to add Python 3.10.5 to PATH. Finally, you need to click on “Install Now” with the recommended settings.

The last step is to make sure Python -M Pip (Python’s package management system) was installed. It’s used to install and manage all software that is related to Python and it’s required for an efficient and smooth Python workspace.

If you’re not sure whether or not you’ve installed Pip, you can check by launching the Command Prompt window on your Windows computer. While there, type in “pip-V” and you can see if Pip is running on your computer.

Summary

There are multiple reasons why Python is one of the most popular programming languages in the world. Thanks to it, numerous programmers and regular people have managed to create wonderful things that are both interesting and useful for them or the community.

This versatile programming language is something anyone can handle thanks to its ease of use and multiple use cases. If you’re willing to learn how to use this free language, you now have the knowledge of how to download, set up, and install it.

Live Chats