Skip to content

Commit 6b94baf

Browse files
authored
Add instructions to install PyGMT using mamba (#1967)
1 parent e8ea414 commit 6b94baf

File tree

2 files changed

+103
-14
lines changed

2 files changed

+103
-14
lines changed

README.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ Simple installation using `conda <https://docs.conda.io/projects/conda/en/latest
8686

8787
conda install --channel conda-forge pygmt
8888

89+
If you use `mamba <https://mamba.readthedocs.org/>`__::
90+
91+
mamba install --channel conda-forge pygmt
92+
8993
For other ways to install ``pygmt``, see `full installation instructions <https://www.pygmt.org/latest/install.html>`__.
9094

9195

doc/install.rst

Lines changed: 99 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,43 @@ Quickstart
88

99
The fastest way to install PyGMT is with the
1010
`conda <https://docs.conda.io/projects/conda/en/latest/user-guide/index.html>`__
11+
or `mamba <https://mamba.readthedocs.io/en/latest/>`__
1112
package manager which takes care of setting up a virtual environment, as well
12-
as the installation of GMT and all the dependencies PyGMT depends on::
13+
as the installation of GMT and all the dependencies PyGMT depends on:
1314

14-
conda create --name pygmt --channel conda-forge pygmt
15+
.. tab-set::
1516

16-
To activate the virtual environment, you can do::
17+
.. tab-item:: conda
18+
:sync: conda
1719

18-
conda activate pygmt
20+
::
21+
22+
conda create --name pygmt --channel conda-forge pygmt
23+
24+
.. tab-item:: mamba
25+
:sync: mamba
26+
27+
::
28+
29+
mamba create --name pygmt --channel conda-forge pygmt
30+
31+
To activate the virtual environment, you can do:
32+
33+
.. tab-set::
34+
35+
.. tab-item:: conda
36+
:sync: conda
37+
38+
::
39+
40+
conda activate pygmt
41+
42+
.. tab-item:: mamba
43+
:sync: mamba
44+
45+
::
46+
47+
mamba activate pygmt
1948

2049
After this, check that everything works by running the following in a Python
2150
interpreter (e.g., in a Jupyter notebook)::
@@ -96,13 +125,41 @@ First, we must configure conda to get packages from the
96125

97126
Now we can create a new conda environment with Python and all our dependencies
98127
installed (we'll call it ``pygmt`` but feel free to change it to whatever you
99-
want)::
128+
want):
129+
130+
.. tab-set::
131+
132+
.. tab-item:: conda
133+
:sync: conda
134+
135+
::
136+
137+
conda create --name pygmt python=3.9 numpy pandas xarray netcdf4 packaging gmt
138+
139+
.. tab-item:: mamba
140+
:sync: mamba
141+
142+
::
100143

101-
conda create --name pygmt python=3.9 numpy pandas xarray netcdf4 packaging gmt
144+
mamba create --name pygmt python=3.9 numpy pandas xarray netcdf4 packaging gmt
102145

103-
Activate the environment by running the following (**do not forget this step!**)::
146+
Activate the environment by running the following (**do not forget this step!**):
104147

105-
conda activate pygmt
148+
.. tab-set::
149+
150+
.. tab-item:: conda
151+
:sync: conda
152+
153+
::
154+
155+
conda activate pygmt
156+
157+
.. tab-item:: mamba
158+
:sync: mamba
159+
160+
::
161+
162+
mamba activate pygmt
106163

107164
From now on, all commands will take place inside the conda virtual environment
108165
called ``pygmt`` and won't affect your default ``base`` installation.
@@ -114,17 +171,45 @@ Installing PyGMT
114171
Now that you have GMT installed and your conda virtual environment activated,
115172
you can install PyGMT using any of the following methods:
116173

117-
Using conda (recommended)
118-
~~~~~~~~~~~~~~~~~~~~~~~~~
174+
Using conda/mamba (recommended)
175+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119176

120177
This installs the latest stable release of PyGMT from
121-
`conda-forge <https://anaconda.org/conda-forge/pygmt>`__::
178+
`conda-forge <https://anaconda.org/conda-forge/pygmt>`__:
179+
180+
.. tab-set::
181+
182+
.. tab-item:: conda
183+
:sync: conda
184+
185+
::
186+
187+
conda install pygmt
188+
189+
.. tab-item:: mamba
190+
:sync: mamba
191+
192+
::
193+
194+
mamba install pygmt
195+
196+
This upgrades the installed PyGMT version to be the latest stable release:
197+
198+
.. tab-set::
199+
200+
.. tab-item:: conda
201+
:sync: conda
202+
203+
::
204+
205+
conda update pygmt
122206

123-
conda install pygmt
207+
.. tab-item:: mamba
208+
:sync: mamba
124209

125-
This upgrades the installed PyGMT version to be the latest stable release::
210+
::
126211

127-
conda update pygmt
212+
mamba update pygmt
128213

129214
Using pip
130215
~~~~~~~~~

0 commit comments

Comments
 (0)