Install Python without the headache

Lesson 2 of 12 · about 12 minutes · Foundations

The problem

Every installation guide offers six options, assumes you know which one you want, and leaves you with two Pythons on the machine and neither of them working.

What you will have at the end

Python and pandas installed, a folder for this course, and a one-line check that proves it works.

The steps

1. Install Python

Download the current release from python.org/downloads and run the installer.

On Windows, tick "Add python.exe to PATH" on the first screen. It is a small unticked box at the bottom and it is the single most common cause of the error at the end of this lesson. If you miss it, re-run the installer and choose Modify.

On macOS, the installer handles this. Do not use the Python that comes with macOS — it is there for the system, not for you.

2. Check it

Open a terminal — Command Prompt or PowerShell on Windows, Terminal on macOS — and type:

python --version

You want a version number. On macOS you may need python3 instead.

3. Make a folder and an environment

A virtual environment keeps this course's packages separate from anything else on your machine. It is one command and it saves a specific kind of misery later.

mkdir survey-python
cd survey-python
python -m venv .venv

Activate it. Windows:

.venv\Scripts\activate

macOS or Linux:

source .venv/bin/activate

Your prompt now starts with (.venv). That is how you know packages will install into this folder rather than system-wide. You have to activate it again every time you open a new terminal — forgetting is normal and the symptom is a package that was definitely installed suddenly not being found.

4. Install what the course uses

pip install pandas openpyxl jupyterlab

pandas does the data work, openpyxl lets it read and write Excel files, and jupyterlab gives you a notebook, which is the friendliest place to start.

5. Prove it works

python -c "import pandas; print(pandas.__version__)"

A version number means you are done.

Where it breaks

'python' is not recognized as an internal or external command

The installer ran but Python is not on your PATH. Re-run the installer, choose Modify, and tick "Add python.exe to PATH". Close and reopen the terminal afterwards — an open terminal keeps the old PATH.

pip is not recognized

Same cause. Try python -m pip install pandas instead, which works even when pip itself is not on the PATH.

ModuleNotFoundError: No module named 'pandas'

Almost always an environment that is not activated. Look for (.venv) at the start of your prompt. If it is missing, activate and try again.

On macOS, python works but python3 is a different version

Use python3 and pip3 consistently, or let the virtual environment settle it — inside an activated .venv, plain python is the right one.

Your turn

Create the folder, make the environment, install the packages and run the version check. Then close the terminal, open a new one, and run the check again — it should fail until you activate the environment. Knowing that failure by sight will save you an hour later.

Next

Open a Kobo export without losing data — the first real file.