1.8. Conda/Mamba

The recommended way to install SPEX is through Conda or Mamba on both Linux and MacOS systems. If you do not have a conda or mamba environment installed, then we recommend to install it through the conda-forge installer.

The install also works for the commercial version of Anaconda, but we recommend to use the open-source conda-forge alternative instead.

Note

We are moving from the commercial version of Anaconda to an open source alternative. This means that the Anaconda spexxray channel is going to be discontinued. Please use https://var.sron.nl/spexconda as channel URL for installing SPEX. The best option is to create a new mamba/conda environment for a fresh SPEX install.

1.8.2. Install SPEX using conda/mamba

Installing SPEX in a conda/mamba environment is as simple as:

(spex) user@linux:~> mamba install -c https://var.sron.nl/spexconda spex

or with conda:

(spex) user@linux:~> conda install -c https://var.sron.nl/spexconda -c conda-forge spex

Mamba will automatically install the dependencies of SPEX. It is possible that you need to re-initialize the conda environment to make SPEX run directly from the command line:

(spex) user@linux:~> mamba deactivate
(base) user@linux:~> mamba activate spex
(spex) user@linux:~> spex
 Welcome user to SPEX version 3.08.03

 Setting the number of threads to  4 for optimal performance.

 Currently using SPEXACT version 2.07.00. Type `help var calc` for details.

SPEX>

You probably want to install more packages in this environment for your purposes, like Jupyterlab or other scientific packages. This can be done using the mamba install command as well.

On an Apple Mac, it is necessary to install an Xserver, like XQuartz.

1.8.3. Running SPEX in conda/mamba

Every time that you want to use SPEX in a new terminal, you have to activate the spex environment:

user@linux:~> mamba activate spex
(spex) user@linux:~>

After this command also the python interface of SPEX should be automatically initialized:

(spex) user@linux:~> python
>>> from pyspex.spex import Session
>>> s=Session()

1.8.4. Pyspextools in conda

Our Python support package pyspextools is also available in conda/mamba:

(spex) user@linux:~> mamba install -c https://var.sron.nl/spexconda pyspextools