Hands-on installation
Install Python and build a small, reproducible test project on your own computer. Work through the checklist below in order. If you get stuck, ask for help.
Step 1 — Install uv
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"curl -LsSf https://astral.sh/uv/install.sh | shClose and reopen your terminal if requested, then check:
uv --versionStep 2 — Install Python
uv python install 3.13Check it is there:
uv python list --only-installedStep 3 — Create a project
mkdir python-local-demo
cd python-local-demo
uv init --bare --python 3.13 --pin-pythonStep 4 — Add packages
uv add jupyterlab pandas matplotlibStep 5 — Verify the environment with a small script
Rather than only checking version numbers, create a tiny script that exercises the interpreter and every package you just installed. Save the following as check_setup.py inside python-local-demo/ (use any text editor, or your terminal):
"""Verify that the project environment is set up correctly."""
import sys
import pandas as pd
import matplotlib
print("Python executable:", sys.executable)
print("Python version: ", sys.version.split()[0])
print("pandas version: ", pd.__version__)
print("matplotlib version:", matplotlib.__version__)
# A tiny bit of real work, so we are testing behaviour, not just imports
df = pd.DataFrame({"x": range(5), "y": [v * v for v in range(5)]})
print("\nA small DataFrame:")
print(df)
print("\nSum of y:", df["y"].sum())Run it inside the project environment:
uv run python check_setup.pyPython executable: /Users/you/python-local-demo/.venv/bin/python
Python version: 3.13.7
pandas version: 2.2.3
matplotlib version: 3.9.2
A small DataFrame:
x y
0 0 0
1 1 1
2 2 4
3 3 9
4 4 16
Sum of y: 30
If this runs without an error and the Python executable path points inside your project folder’s .venv/, your environment is correctly set up end to end.
Optional — inspect the resolved dependency graph:
uv treeStep 6 — Start JupyterLab
uv run jupyter labA browser window should open automatically. If it does not, look in the terminal output for a local URL beginning with something like:
http://localhost:8888/lab?token=...
and copy that into your browser manually.
Inside JupyterLab, open a new notebook and run the same checks interactively, cell by cell:
import sys
print(sys.executable)import pandas as pd
pd.DataFrame({"a": [1, 2, 3]})To stop JupyterLab, return to the terminal and press Ctrl+C.
Step 7 — Reproducibility check
Look inside your project folder. Can you identify these?
.python-version
pyproject.toml
uv.lock
.venv/
check_setup.py
Explain to the person next to you, or to yourself:
- Which files would you commit to Git?
- Which directory would you not commit?
- Which file records the direct, declared dependencies?
- Which file records the resolved, exact dependency versions?
- Which command runs Python inside the project’s own environment?
- Commit
.python-version,pyproject.toml,uv.lock,check_setup.py, and any other research code or notebooks. - Do not commit
.venv/. pyproject.tomlrecords the project’s declared dependencies.uv.lockrecords the resolved dependency graph.uv run python(oruv runfollowed by any other command) runs it inside the project environment.
If you finish early
- Add another package, for example
uv add seaborn, and inspect howpyproject.tomlanduv.lockboth change. - Run
uv treeand try to find a package that is a shared transitive dependency of two of your direct dependencies. - Delete
.venv/entirely and rebuild it withuv sync— confirmcheck_setup.pystill works afterwards. - Compare the output of
python --version(your system’s global command) withuv run python --version(the project’s command) — are they the same on your machine? - Install a second Python minor version (for example
uv python install 3.12) and inspectuv python list --only-installed.