This repository provides the setup materials for the course Machine Learning for Predictive Maintenance. Its main purpose is to help students configure a standardized programming environment on their personal machines. By following the instructions here, all students will work with the same package versions, dependencies, and tools, ensuring that assignments and projects run smoothly and reproducibly across different systems.
⚠️ NOTE️: Students are strongly encouraged to use the proposed environment. If you decide not to, you are fully responsible for ensuring the reproducibility of your code. No support will be provided during class for debugging dependency issues or Python installation problems outside of the standardized setup.
For this course, we use uv as the Python dependency
manager. uv is a fast, cross-platform tool that ensures consistent development
environments across Windows, macOS, and Linux. By relying on it, we avoid version
conflicts and guarantee that assignments and projects behave the same way on all systems.
All Python packages required for the course are specified in this repository, and uv
will automatically install them in a clean, isolated virtual environment.
For development, we will use Visual Studio Code as
the recommended editor. It integrates smoothly with Python environments created by uv
and provides useful features such as linting, debugging, and notebook support.
In summary, the installation process consists of:
- Installing
uvon your system - Creating the course Python environment using the provided configuration
- Opening the project in Visual Studio Code and linking it to the environment
Prior to starting the installation process, we recommend that you have the following:
- Git (strongly recommended): We strongly encourage students to use Git for version control of their code and project files. Version control will help you track changes and recover previous versions of your work if needed. To commit Jupyter notebooks, we recommend committing them with all output cells cleared. This makes it easier to compare different versions of the notebooks and avoids unnecessary clutter in your Git history.
✅️ NOTE️: The following installation procedure supports hardware acceleration on macOS with Apple Silicon chips using the MPS device. No special steps are required.
-
Open a terminal.
-
Install uv using the official instructions:
curl -LsSf https://astral.sh/uv/install.sh | sh-
Restart your terminal (as requested at the end of the installation process).
-
Install Python 3.10 with
uv:
uv python install 3.10- Clone this GitHub repository (somewhere on your machine):
git clone https://github.com/EPFL-IMOS/MLPM2025- Navigate inside the cloned repository:
cd MLPM2025- Create the Python virtual environment using
uv:
uv sync- Activate the
pythonvirtual environment we just created.⚠️ NOTE: this must be ran everytime you open a new terminal and want to use theMLPM2025Python environment.
source .venv/bin/activate✅️ NOTE️: The following installation procedure supports hardware acceleration with CUDA 12.4 on Windows if you have an NVIDIA GPU. No special steps are required.
- Open a 64-bits Powershell terminal.
⚠️ NOTE: We will always assume that your terminal is a Powershell instance, not a Command Prompt. 🚨 WARNING: Make sure you open a 64-bits Powershell terminal, and not a 32-bitsPowershell (x86)terminal.
- Install uv using the official instructions:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"-
Restart your terminal (as requested at the end of the installation process).
-
Install Python 3.10 with
uv:
uv python install 3.10- Clone this GitHub repository (somewhere on your machine):
git clone https://github.com/EPFL-IMOS/MLPM2025- Navigate inside the cloned repository:
cd MLPM2025- Create the Python virtual environment using
uv:
uv sync- Activate the
pythonvirtual environment we just created.⚠️ NOTE️: this must be ran everytime you open a new terminal and want to use theMLPM2025Python environment.
.venv\Scripts\activate.ps1✅️ NOTE️: The following installation procedure supports hardware acceleration with CUDA 12.4 on Linux if you have an NVIDIA GPU. No special steps are required.
-
Open a terminal.
-
Install uv using the official instructions. If you face an error saying that
curlis missing, you can install it withsudo apt install curl, or usewgetinstead.
curl -LsSf https://astral.sh/uv/install.sh | sh-
Restart your terminal (as requested at the end of the installation process).
-
Install Python 3.10 with
uv:
uv python install 3.10- Clone this GitHub repository (somewhere on your machine):
git clone https://github.com/EPFL-IMOS/MLPM2025- Navigate inside the cloned repository:
cd MLPM2025- Create the Python virtual environment using
uv:
uv sync- Activate the
pythonvirtual environment we just created.⚠️ NOTE: this must be ran everytime you open a new terminal and want to use theMLPM2025Python environment.
source .venv/bin/activate-
Install Visual Studio Code on your machine.
-
Open VS Code and install the official Python extension inside VS Code as follows:
- Install the official Jupyter extension inside VS Code as follows:
-
Open the
MLPM2025directory inside VS Code using "File" >> "Open Folder". -
Open the
notebooks/test.ipynbJupyter Notebook inside VS Code. Select the newly created virtual environment as kernel:
- Run the entire Jupyter notebook by clicking on "Run All" at the top of the notebook. The notebook should run without any issues, and should determine if your installation supports hardware acceleration or not.
- To make sure you can use this environment in different folders, you need to add it to the Visual Studio Code settings. Open the "Command Palette" by clicking on "View" -> "Command Palette". Then, search for "User Settings":
- Search for "venv" in the settings search bar, and add the location of your virtual
environment to the "Venv folders" list.
⚠️ NOTE: the folder will be different on your machine. Change to the right location for your specific machine.
- Can I delete the
MLPM2025repository after installation?
No you cannot, because your Python virtual environment is stored entirely inside the
.venv folder in the repository.
- I want to delete the
MLPM2025virtual environment. How can I do it?
Navigate to the MLPM2025 repository on your machine, and delete the .venv
directory.
- I messed up the
MLPM2025virtual environment. How can I recover?
Navigate to the root of the MLPM2025 repository on your machine, and delete the .venv
directory. Then, run uv sync from a terminal at the root of the MLPM2025 repository.
- The TAs told me to update my virtual environment. How can I do it?
Navigate to the root of the MLPM2025 repository on your machine, and run uv sync
from a terminal.
- I want to install a new package/dependency. How can I do it?
First, make sure you really need that additional dependency. Then, if you absolutely
need to install it, use uv add to add a new package to the virtual environment. For
example, uv add torchinfo to add the torchinfo package.









