A dev environment template for students of courses by the ML working group.
This tutorial will guide you through setting up a local development environment for your machine learning courses.
If you prefer to not work on your local machine, you can also use services like Google Colab.
We will use VSCode as the IDE and uv as the package manager. Feel free to use any other package manager, but we recommend using uv for its simplicity and environment management features. To follow this tutorial, you should have git, VSCode, and uv installed on your machine.
-
Navigate to a folder where you want to store the code.
-
Clone the repository using the command:
git clone https://github.com/ml-uhh/python-template.git
-
Open the folder in VSCode.
code python-template
We have already initialized the project. Use uv to install the dependencies and create an environment.
uv syncThere should now be a new folder containing the environment at ./.venv/
- Open the numpy tutorial notebook.
- In the top right corner, select the Python environment created by
uv(should be calledpython-template). - You should now be able to run the notebook cells.
You may notice that some cells report missing packages. For example, numpy and matplotlib are missing.
You can add them using uv:
uv add numpy matplotlib