Installation#
On all platforms, we recommend to install pyGIMLi via the conda package manager contained in the Anaconda Python distribution. For details on how to install Anaconda, see this page.
Note that Anaconda comes with many (great) packages, many of which you likely will not use. If you want to save space, you can install the light-weight version Miniconda.
Note
After installing Anaconda or Miniconda, make sure that you have at least version 23.10.0 of conda (conda –version).
To avoid conflicts with other packages, we recommend to install pyGIMLi in a separate environment. Here we call this environment pg, but you can give it any name. Note that this environment has to be created only once.
Open a terminal (Linux & Mac) or the Anaconda Prompt (Windows) and type:
conda create -n pg -c gimli -c conda-forge "pygimli>=1.5.0"
If you want to use pyGIMLi from the command line, you have to activate the environment. You can put this line in your ~/.bashrc file so that it is activated automatically if you open a terminal.
conda activate pg
After that you can use pyGIMLi with your text editor of choice and a terminal.
Usage with Spyder or JupyterLab#
Depending on your preferences, you can also install third-party software such as the MATLAB-like integrated development environment (https://www.spyder-ide.org):
conda install -c conda-forge spyder
Or alternatively, the web-based IDE JupyterLab (https://jupyterlab.readthedocs.io):
conda install -c conda-forge jupyterlab
If you do one of the above steps in the pg environment, then it will automatically find pyGIMLi. But you may not want to install JupyterLab or Spyder for every different environment. To use your existing JupyterLab installation in the base environment with pyGIMLi in the pg environment, follow these steps:
conda activate pg
conda install ipykernel
conda activate base
conda install -c conda-forge nb_conda_kernels
jupyter lab
pyGIMLi on Google Colab#
Even though still experimental, pyGIMLi can be run on Google Colab without any installation on your own computer. Just create a new Notebook and install the pyGIMLi package via pip:
!pip install pygimli tetgen
Staying up-to-date#
Update your pyGIMLi installation from time to time, if want to have the newest functionality.
conda update -c gimli -c conda-forge pygimli
If there something went wrong and you are running an old, not further supported python version, consider a fresh install in a new clean environment. The only drawback of using conda is that you are bound to the rhythm in which we update the conda packages. In order to work with the latest Python codes you should create an environment with the latest pyGIMLi C++ core only,
conda create -n pgcore -c gimli -c conda-forge pgcore
retrieve the source code by git
git clone https://github.com/gimli-org/gimli
cd gimli
and install pygimli as a development package using conda
conda develop .
or using pip
pip install --no-build-isolation --no-deps -e .
Alternatively you could set the PYTHONPATH variable but you would have to care for dependencies by yourself.
Later you can just update the pygimli code by
git pull
Only if you need recent changes to the C++ core, you have to compile pyGIMLi using your systems toolchain as described in https://www.pygimli.org/compilation.html#sec-build
Note
If you want to compile pyGIMLi from source, check out Building from source.