Mamba
as package manager¶After we got to know Python and its programmatic aims theoretically, we want to get started now! At first you need a working Python installation on your local computer system. For this purpose, we want to introduce mamba
as a package manager.
A package manager is primarily used to install new python packages on your local system. But furthermore, a package manager is a powerful tool, that also keeps your working system clean and manages all the dependencies between the each package, that you want to use for your project. For instance, your aim is to solve a (recurring) problem by writing a piece of Python code. First you need to decide, which Python version you want to use for your programming task. As every other software Python is continuously developed. New versions implement new features or ways to solve problems programmatically. The downside is, that older features may be deleted or removed from a newer Python distribution. Therefore, as a starting point, you must decide which Python version is the best to solve your problem. Normally you would prefer newer versions instead of older Python versions especially in terms of security aspects. But you should also consider stability concerns in your decision process. Major versions tend to be more stable and in use longer. In the end, the selection of your Python version also determines the version of your packages that you want to use to solve your individual problem. In a nutshell a package manager makes all of these a lot easier for you at no cost. You only have to decide which Python version you want to use. Your package manager will make sure that all the packages that you want to use for your project will match with your Python version. This is a fantastic feature and saves you a lot of working time! Moreover, using a package manager will make sure that you can share your code easily with others. This enables you to collaborate with other users without any overhead. Others not only can support you instantly but have also the possibility to reproduce your coding environment on their own computer systems. All this is done by the package manager automatically!
Mamba
as package manager of choice¶Since you should now be more than convinced to use a package manager for your (Python) projects, in the following a guideline for installing Mamba
and Python on your local computer system is provided. If you want to learn more about package managers and Mamba
itself, you can find tons of resources on the internet. A good starting point would be Mambas
online documentation.
Depending on your operating system you should at first download the newest version of Mamba
here. Just click on the package that fits to your operating system:
Afterwards start the installation process on your local computer system. A guide for this is provided by the mamba development team.
mamba
environments over your tutorial experience¶Once you have successfully installed mamba
, you can use all features over the command line interface (CLI). All chapters of this Python tutorial are consistently implemented with mamba as package manager. In each section you have the option to download a mamba
environment file to easily set up a preconfigured Python environment with all required packages for this specific part of the tutorial. Additionally, a listing of all necessary packages is provided at the beginning of each chapter. This allows you to install the required packages on your own in your mamba
environment of choice.
Nonetheless we strongly recommend the use of the provided mamba
environment file. The use of this environment file ensures, that your local Python environment is completely identical to the environments used in the making of this tutorial. Therefore, the provided code will work also on your local machine without any limitations.
In the following a short introduction to the handling of mamba
is given. Furthermore, you will also learn how to create your first mamba
environment by yourself. Concluding it is explained, how you can set up a mamba
environment with the help of an environment file. If you want to learn more about all these, we recommend you to have a look at mambas'
online documentation.
Citation
The E-Learning project SOGA-Py was developed at the Department of Earth Sciences by Annette Rudolph, Joachim Krois and Kai Hartmann. You can reach us via mail by soga[at]zedat.fu-berlin.de.
Please cite as follow: Rudolph, A., Krois, J., Hartmann, K. (2023): Statistics and Geodata Analysis using Python (SOGA-Py). Department of Earth Sciences, Freie Universitaet Berlin.