How to Install Python, Jupyter Notebook and VS Code for Data Science (Windows and Mac)
P1.2 How to Install Python on Windows and Mac
Why. Without Python installed, nothing else in this course will run. The most common beginner problem is a wrong install, so we do it carefully once.
What. We install Python 3 (version 3.10 or newer). On Windows we use the installer from python.org. On Mac we use the python.org installer too. You can also install Anaconda, which brings Python, Jupyter and pandas together.
How.
Install on Windows
- Open python.org/downloads in your browser.
- Click the yellow "Download Python 3.x" button.
- Open the downloaded file.
- Tick the box Add python.exe to PATH. This is very important.
- Click Install Now and wait.
- Click Close when it says "Setup was successful".
How.
Install on Mac
- Open python.org/downloads.
- Download the macOS installer (.pkg).
- Open it and click Continue on each screen.
- Click Install and type your Mac password.
- When it finishes, open Applications → Python 3.x and double-click Install Certificates.command.
Worked example A — Check the Python version (Windows).
Step 1 — What we do. Open Command Prompt (press Windows key, type cmd, press Enter) and check the version.
Step 2 — Type and run this code.
python --version
Step 3 — Output you should see.
Python 3.12.4
Step 4 — What it means. If you see a version number, Python is installed and on the PATH. If you see "not recognized", reinstall and tick "Add python.exe to PATH".
Worked example B — Check the Python version (Mac).
Step 1 — What we do. Open Terminal (press Cmd+Space, type Terminal, press Enter). On Mac the command is python3.
Step 2 — Type and run this code.
python3 --version
Step 3 — Output you should see.
Python 3.12.4
Step 4 — What it means. On Mac always type python3 and pip3. Plain python may point to nothing or to an old version.
Worked example C — Run one line from the terminal.
Step 1 — What we do. We run a tiny calculation without opening any editor. A bank in Frankfurt adds 2% interest to €1,000.
Step 2 — Type and run this code.
python -c "print(1000 * 1.02)"
Step 3 — Output you should see.
1020.0
Step 4 — What it means. -c means "run this code". The answer 1020.0 is €1,020. Mac users type python3 -c ....
Ravindra Bagale's Tip
On Windows, the "Add python.exe to PATH" box decides everything. If you forgot it, do not fight with settings. Uninstall Python, install again and tick the box.
Ravindra Bagale's Tip – मराठी
Windows वर "Add python.exe to PATH" हा box सगळं ठरवतो. विसरलात तर settings शी भांडू नका. Python uninstall करा, परत install करा आणि box tick करा.
Ravindra Bagale's Tip – हिंदी
Windows पर "Add python.exe to PATH" वाला box सब तय करता है. भूल गए तो settings से मत लड़ो. Python uninstall करो, फिर से install करो और box tick करो.