 Hello, welcome back on my YouTube channel. In this video you'll learn how to install Mamba and set up a Python environment with QGIS and other Python packages. This video is part of the OpenCourse Programming for Geospatial Hydrological Applications that you can find at GISOpenCourseWare.org. In previous versions of the course we have used Anaconda as the distribution. Anaconda, however, is very big to download, around 3 gigabytes, and contains many packages that you will not use. Then we switch to using Miniconda, which is much smaller and you add the packages that you need. Recently, however, we see that many people move to Mamba, and also my experience with Mamba is that it's much faster and gives less problems. So in this video we'll cover Mamba. Alexander Netto, who has written the original blog post on how to use QGIS in a conda environment, has updated his blog and you'll find the link to the new blog post in the description of this video. And in the blog post you also find other essential information on installing QGIS in conda. And it's a great way to combine QGIS with other Python packages and have multiple installations and versions of QGIS in separate environments. Christian Mills also wrote a great tutorial on setting up a local Python environment with Mamba. I'll provide also the link to this tutorial in the description of this video. We'll start by downloading the Mamba Forge installer from GitHub. It's provided for different operating systems and here I'll explain how to install it for Windows. So I'll download the installer for Windows and then I open it. In Edge it will complain that it doesn't know this installer and that you need to create an exception here. So if you go to show more, you can choose keep anyway and overrule that this is blocked. Then run the installer and go through the wizard, agree with the terms, install it just for yourself, keep the defaults here. The only thing we change here is clear the package cache upon completion which is recommended to cover some disk space and then click install. Click next and finish after installing. Now go to the start menu and search for mini Forge prompt. Then click on it and it will open the prompt. You'll see in brackets base, this means you are now in the base environment. Let's start with creating a new environment and also installing packages. If you're familiar with Konda, the command looks very similar. The only difference is that we use Mamba instead of Konda and Mamba also uses Konda Forge, the open source channel by default so we don't need to specify it. Here you see Mamba create and then name, after name the tutorials, that's the name of the environment and then the packages that we want to install, in this case PC Raster, QGIS and some other ones. If you want a specific version, you can use an equal sign and then the version number. Press enter and then Mamba starts looking for these packages on the repository Konda Forge and then confirm the changes by typing Y and enter. Installing Mamba will tell you how to activate the environment. So here we type Mamba activate tutorials. Every time you open the Mini Forge prompt in the future, you will need this command to go into the environment tutorials, which is now displayed also in brackets before the prompt. This environment now contains the packages that we have installed. Now for the tutorials, I clone the GitHub repository. So I go to the GitHub repository and copy the HTTPS link. Then I use the command get clone and with the right click, I can paste the link here and it will copy the content of the repository to a folder with the name of the repository. Let's have a look at the contents of this folder and here we see the PC Raster tutorials subfolder, which has the tutorials from the repository and I can now launch Jupyter Lab by typing JupyterLab. You will normally open your browser, but in my case, I need to use these links here with control click to open it in my browser and choose the Python tree kernel. Then you can go to the folder and choose Jupyter notebook with the IPyNB extension and that will then open on the right side. Important thing to do is then choose a new console for the notebook, so the two are linked and you can see we use Python 3.11. If I click the plus sign, I'll get the launchers and it's also nice to have here a terminal. So I have a notebook, I got a console and I got a terminal and I can drag them to the positions where I want and organize the web page in this way. I can run the code by using shift return. After you've used the Jupyter notebook, you can correctly shut down by choosing file shut down from the menu and then you can close that otherwise the server will still be running and using resources. Now you see the prompt is back and the server has been closed down. When I start a new session with the MiniForge prompt, I need to always go to the proper environment that I want to use. So there you use the same command Mamba activate tutorials in this case that brings you back to the environment that we are working in. In this video, you've learned how to install Mamba and how to create an environment and use JupyterLab.