Desktop Use with Conda - mspass-team/mspass GitHub Wiki
Desktop Use with Conda
Installing the MsPASS Conda package
MsPASS has an conda package that is one option for installing a local copy of mspass. This approach is most appropriate for the system you use for developing a workflow. It will likely prove useful in other contexts as well, but this page focuses on desktop use.
If you don't have a variant of conda installed you should do that first. See the anaconda document for system specific instructions. We recommend a full install rather than miniconda if you are on your personal device. On shared systems, miniconda or mamba is recommended.
We strongly advise you create a separate environment for mspass
to avoiding breaking any existing python packages you may have
installed previously. Make sure you are on the base
environment
and enter
conda create --name mspass_env
Noting the name "mspass_env" is not special and it can be changed if you prefer something else. You should then make the new environment current with the standard conda command:
conda activate mspass_env
You will almost certainly need to add key "channels" as follows:
conda config --add channels mspass
conda config --add channels conda-forge
Then install mspass in this environment with
conda install -y mspasspy
Note that the conda package is available here. Currently the supported platforms are linux-64, linux-aarch64, osx-64, and osx-arm64. You may want to use one of the tags for specific python versions referenced on that page.
Define MSPASS_HOME
A few things in MsPASS require data in the data/yaml directory of the MsPASS code repository. You should thus also download load a local copy of the MsPASS repository that hosts this wiki. You can either set the environment variable MSPASS_HOME to the master copy of data/yaml in the repository or copy it do somewhere else. Use the correct incantation for the shell you are using to set MSPASS_HOME. You may want to put it in the shell initialization file.
Setting up MongoDB
Since almost all MsPASS workflows utilize MongoDB you will need to have an instance of MongoDB running on your desktop system. For most people the easiest way to get MongoDB running is to use the standard MsPASS docker container. See the user manual and elsewhere in this wiki for more about docker, but assuming you have docker desktop this is easily done in two steps. First, launch a terminal and make the the current directory the run directory for MongoDB. When the MsPASS container launches it will, by default, create
a data
directory it uses as it's work area and a logs
directory where the mongodb server log will be written. Second, run this incantation:
docker run --env MSPASS_ROLE=db -p 27017:27017 --mount src=`pwd`,target=/home,type=bind mspass/mspass
Noting that the -p options is needed to allow the mongodb server port 27017 to be accessible outside the container. If there is a conflict with port 27017 on your system you may need to change that line.