From a96f5bbf12e50a361a3bffae6e6097ebc81bf745 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Fri, 17 Jun 2022 12:38:40 +0800 Subject: [PATCH] Add instructions to install PyGMT using mamba --- README.rst | 4 ++ doc/install.rst | 112 ++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 102 insertions(+), 14 deletions(-) diff --git a/README.rst b/README.rst index a6610a59b54..f1e2f3fab8a 100644 --- a/README.rst +++ b/README.rst @@ -86,6 +86,10 @@ Simple installation using `conda `__:: + + mamba install --channel conda-forge pygmt + For other ways to install ``pygmt``, see `full installation instructions `__. diff --git a/doc/install.rst b/doc/install.rst index ac19df0edaf..900882cbe28 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -8,14 +8,42 @@ Quickstart The fastest way to install PyGMT is with the `conda `__ +or `mamba `__ package manager which takes care of setting up a virtual environment, as well -as the installation of GMT and all the dependencies PyGMT depends on:: +as the installation of GMT and all the dependencies PyGMT depends on: - conda create --name pygmt --channel conda-forge pygmt +.. tab-set:: -To activate the virtual environment, you can do:: + .. tab-item:: conda + :sync: conda - conda activate pygmt + :: + + conda create --name pygmt --channel conda-forge pygmt + + .. tab-item:: mamba + :sync: mamba + + :: + mamba create --name pygmt --channel conda-forge pygmt + +To activate the virtual environment, you can do: + +.. tab-set:: + + .. tab-item:: conda + :sync: conda + + :: + + conda activate pygmt + + .. tab-item:: mamba + :sync: mamba + + :: + + mamba activate pygmt After this, check that everything works by running the following in a Python interpreter (e.g., in a Jupyter notebook):: @@ -96,13 +124,41 @@ First, we must configure conda to get packages from the Now we can create a new conda environment with Python and all our dependencies installed (we'll call it ``pygmt`` but feel free to change it to whatever you -want):: +want): + +.. tab-set:: + + .. tab-item:: conda + :sync: conda + + :: + + conda create --name pygmt python=3.9 numpy pandas xarray netcdf4 packaging gmt + + .. tab-item:: mamba + :sync: mamba + + :: + + mamba create --name pygmt python=3.9 numpy pandas xarray netcdf4 packaging gmt - conda create --name pygmt python=3.9 numpy pandas xarray netcdf4 packaging gmt +Activate the environment by running the following (**do not forget this step!**): -Activate the environment by running the following (**do not forget this step!**):: +.. tab-set:: - conda activate pygmt + .. tab-item:: conda + :sync: conda + + :: + + conda activate pygmt + + .. tab-item:: mamba + :sync: mamba + + :: + + mamba activate pygmt From now on, all commands will take place inside the conda virtual environment called ``pygmt`` and won't affect your default ``base`` installation. @@ -114,17 +170,45 @@ Installing PyGMT Now that you have GMT installed and your conda virtual environment activated, you can install PyGMT using any of the following methods: -Using conda (recommended) -~~~~~~~~~~~~~~~~~~~~~~~~~ +Using conda/mamba (recommended) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This installs the latest stable release of PyGMT from -`conda-forge `__:: +`conda-forge `__: + +.. tab-set:: + + .. tab-item:: conda + :sync: conda + + :: + + conda install pygmt + + .. tab-item:: mamba + :sync: mamba + + :: + + mamba install pygmt + +This upgrades the installed PyGMT version to be the latest stable release: + +.. tab-set:: + + .. tab-item:: conda + :sync: conda + + :: + + conda update pygmt - conda install pygmt + .. tab-item:: mamba + :sync: mamba -This upgrades the installed PyGMT version to be the latest stable release:: + :: - conda update pygmt + mamba update pygmt Using pip ~~~~~~~~~