This guide walks through the complete process of running the Hands-On ML notebooks on your own machine. The setup uses Anaconda (or Miniconda) to create an isolatedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ageron/handson-ml3/llms.txt
Use this file to discover all available pages before exploring further.
homl3 conda environment with Python 3.10 and every library the notebooks require. If you just want to try a few notebooks without installing anything, see the cloud options instead.
Installation walkthrough
Install git
Open a terminal and type
git to check whether it is already installed. If not, download it from git-scm.com.On Windows, after installation you should use the Anaconda Shell (not the standard Command Prompt) for all subsequent steps.Install Anaconda or Miniconda
Download and install Anaconda or the lighter Miniconda. Either works — Anaconda bundles many scientific packages, while Miniconda is minimal and only installs what is needed.
- macOS / Linux: Accept the
conda initprompt during installation so thatcondais available in every new terminal. Restart your terminal after installation. - Windows: Do not add Anaconda to the system
PATHwhen the installer asks. Instead, open Anaconda Shell from the Start Menu whenever you want to use conda.
Clone the repository
Navigate to the directory where you want to store the project, then clone the repository:If you prefer not to use git, download main.zip, unzip it, rename the resulting directory to
handson-ml3, and move it to your development directory.Create the homl3 conda environment
From inside the This step takes several minutes. When it completes, activate the new environment:
handson-ml3 directory, create the environment using the included environment.yml file. This installs Python 3.10 along with Scikit-Learn 1.3, TensorFlow 2.14, Keras, NumPy 1.26, Pandas 2.1, Matplotlib 3.8, and all other dependencies:The environment name is
homl3 by default. If you want a different name, pass -n your_name to the conda env create command. You will then need to adjust the conda activate command accordingly.Register the Jupyter kernel
Register the
homl3 environment as a Jupyter kernel named python3. The notebooks default to a kernel named python3, so using this name means you will not need to change the kernel manually every time you open a notebook:Launch Jupyter
Start Jupyter Notebook:Jupyter will open in your browser and show the contents of the
handson-ml3 directory. Click index.ipynb to see the table of contents and navigate to any chapter. If your browser does not open automatically, visit localhost:8888.To stop Jupyter, press Ctrl-C in the terminal where you started it.Starting Jupyter in future sessions
Each time you want to work on the notebooks, open a terminal and run:GPU setup (NVIDIA)
If you have a TensorFlow-compatible NVIDIA GPU (Compute Capability 3.5 or higher), you can enable GPU acceleration for the deep learning chapters.Install the NVIDIA GPU driver
Download and install the latest driver for your GPU from nvidia.com.
Install CUDA and cuDNN
When you install TensorFlow from the Anaconda channel (which the
environment.yml does), CUDA and cuDNN are installed automatically alongside TensorFlow. You do not need to install them manually.If you are not using Anaconda, follow the manual GPU installation instructions at tensorflow.org/install/gpu.Updating the project
The notebooks are updated regularly to fix issues and add library support. To update your local copy:git pull fails because you modified a notebook, commit your changes to a branch first:
Conda vs pip
The recommended approach is to use conda withenvironment.yml, which handles all library versions and binary dependencies (including GPU support) in a tested, consistent way.
If you prefer not to use Anaconda, you can install the libraries with pip using requirements.txt:
Library versions installed
Theenvironment.yml specifies exact versions for reproducibility. Key packages include:
| Package | Version |
|---|---|
| Python | 3.10 |
| Scikit-Learn | 1.3 |
| TensorFlow | 2.14 |
| NumPy | 1.26 |
| Pandas | 2.1 |
| Matplotlib | 3.8 |
| JupyterLab | 4.0 |
| Keras Tuner | 1.4.6 |
| Transformers | 4.35 |