Vinay Garg Assistant Professor

Lesson 2: Hardware and software requirements, and installing Python

Python needs very little: any computer from the last ten years, about 200 MB of disk and an internet connection once. Here is what to check, how to install it on Windows and Linux, and how to prove it worked.

A dark code window showing a version check and platform output

In short

  • Any computer that runs Windows 10, macOS 12 or a current Linux distribution can run Python; 2 GB of RAM and 200 MB of disk is enough to start.
  • Download Python 3 from python.org; on Windows tick "Add python.exe to PATH" during setup or the command will not be found.
  • The three checks after installing are `python --version`, `pip --version` and running one line of code.
  • Python itself is free; an editor such as IDLE, VS Code or PyCharm is a choice, not a requirement.

200 MB

disk space a standard Python install needs

python.org

1

checkbox that decides whether python works in the terminal

Windows installer

Hardware requirements

Python is light. These are comfortable minimums for learning, not limits:

ComponentPractical minimumWhy
ProcessorAny 64-bit x86 or ARM processor from the last 10 yearsPython itself is small; the editor is heavier than the language.
Memory (RAM)2 GB, 4 GB comfortableIDLE needs very little; a browser and an IDE at the same time need more.
Disk spaceAbout 200 MB for Python and pip, 1 GB including an editorStandard library and documentation are included.
Display1024 × 768IDLE is a plain window; nothing graphical is required to learn.
InternetOnce, to download the installerPython runs offline afterwards.

Software requirements

  • Operating system: Windows 10 or 11, macOS 12 or later, or any current Linux distribution such as Ubuntu 22.04.
  • Python version: Python 3.10 or newer. Python 2 is retired and should not be used for new work.
  • pip: the package installer. It comes with the official Python installer, so there is nothing extra to fetch.
  • An editor: IDLE is installed with Python and is enough for this course.

Installing on Windows, step by step

  1. Open python.org/downloads and choose the Windows installer for the latest Python 3.
  2. Run the installer. On the first screen, tick "Add python.exe to PATH". This single checkbox is what makes the python command work in the command prompt.
  3. Choose "Install Now" and wait for it to finish.
  4. Open the Start menu, type cmd, and press Enter.
  5. Type python --version. You should see something like Python 3.10.12.
  6. If that command is not recognised, try py --version. The py launcher is installed with Python on Windows and always finds it.

If your machine runs Linux or macOS

The course assumes Windows, because that is what the lab uses, and every example works the same way on the other systems. Only the commands to install and run differ:

# Ubuntu or Debian
sudo apt update
sudo apt install python3 python3-pip

# Fedora
sudo dnf install python3 python3-pip

# macOS with Homebrew
brew install python

On Linux the command is usually python3 instead of python, because python may still point at an old Python 2 on some systems.

Proving the installation works

import sys

print("Version:", sys.version.split()[0])
print("Platform:", sys.platform)
print("Install folder:", sys.prefix)
print("2 + 3 =", 2 + 3)
Version: 3.10.12
Platform: win32
Install folder: C:\\Program Files\\Python310
2 + 3 = 5

The version and folder will differ on your machine; both are there to prove Python is installed and to show where it lives.

Common installation problems

  • "python is not recognized". The PATH checkbox was missed. Re-run the installer, choose Modify, and add Python to PATH.
  • An old version opens. Another Python is earlier in PATH. Use py -3 on Windows or python3 on Linux to be explicit.
  • pip is missing. Run python -m ensurepip --upgrade, which restores it.

Practice

Try these before moving on. Each one uses only what this lesson covered.

  1. Install Python 3 on your own machine and print the version from the command prompt or terminal.
  2. Run `pip --version` and note which Python installation it belongs to.
  3. Print `sys.platform` and `sys.maxsize` and explain in a comment what each one tells you.

Sources

Frequently asked questions

What hardware do I need to run Python?

Any computer from the last ten years. About 200 MB of disk and 2 GB of RAM is enough for Python and IDLE; a browser and a full editor at the same time want 4 GB.

Which version of Python should I install?

The latest Python 3 release, at least 3.10. Python 2 reached end of life in 2020 and most teaching material that uses it is out of date.

Is Python free to install and use?

Yes. Python is open source under the Python Software Foundation licence, free for personal, academic and commercial use. Editors such as IDLE and VS Code are also free.

Do I need an internet connection to write Python programs?

No, only to download the installer. After that everything in this course runs offline, because the standard library is already installed.

Vinay Garg

Vinay Garg

Assistant Professor of Computer Science at Multani Mal Modi College, Patiala. Twenty-five years of teaching web programming, and a habit of building the things I teach about.