Skip to content

Commit 0bb0500

Browse files
core-manmichaelgrundseismanweiji14
authored
Add instructions to upgrade installed PyGMT version (#1029)
Co-authored-by: Michael Grund <michael_grund@gmx.de> Co-authored-by: Dongdong Tian <seisman.info@gmail.com> Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
1 parent 88fafa5 commit 0bb0500

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

doc/install.rst

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ To activate the virtual environment, you can do::
2929
conda activate pygmt
3030

3131
After this, check that everything works by running the following in a Python
32-
interpreter (e.g. in a Jupyter notebook)::
32+
interpreter (e.g., in a Jupyter notebook)::
3333

3434
import pygmt
3535
pygmt.show_versions()
@@ -40,8 +40,8 @@ Start by looking at the tutorials on our sidebar, good luck!
4040
.. note::
4141

4242
The sections below provide more detailed, step by step instructions to
43-
installing and testing PyGMT for those who may have a slightly different
44-
setup.
43+
install and test PyGMT for those who may have a slightly different setup or
44+
want to install the latest development version.
4545

4646
Which Python?
4747
-------------
@@ -51,9 +51,10 @@ work, but there is no guarantee that PyGMT will behave as expected.
5151

5252
We recommend using the `Anaconda <https://www.anaconda.com/distribution>`__
5353
Python distribution to ensure you have all dependencies installed and the
54-
``conda`` package manager available.
55-
Installing Anaconda does not require administrative rights to your computer and
56-
doesn't interfere with any other Python installations in your system.
54+
`conda <https://docs.conda.io/projects/conda/en/latest/>`__
55+
package manager is available. Installing Anaconda does not require administrative
56+
rights to your computer and doesn't interfere with any other Python
57+
installations on your system.
5758

5859

5960
Which GMT?
@@ -110,14 +111,14 @@ Now we can create a new conda environment with Python and all our dependencies
110111
installed (we'll call it ``pygmt`` but feel free to change it to whatever you
111112
want)::
112113

113-
conda create --name pygmt python=3.9 pip numpy pandas xarray netcdf4 packaging gmt
114+
conda create --name pygmt python=3.9 numpy pandas xarray netcdf4 packaging gmt
114115

115116
Activate the environment by running the following (**do not forget this step!**)::
116117

117118
conda activate pygmt
118119

119120
From now on, all commands will take place inside the conda virtual environment
120-
called 'pygmt' and won't affect your default 'base' installation.
121+
called ``pygmt`` and won't affect your default ``base`` installation.
121122

122123

123124
Installing PyGMT
@@ -134,6 +135,10 @@ This installs the latest stable release of PyGMT from
134135

135136
conda install pygmt
136137

138+
This upgrades the installed PyGMT version to be the latest stable release::
139+
140+
conda update pygmt
141+
137142
Using pip
138143
~~~~~~~~~
139144

@@ -147,13 +152,11 @@ Alternatively, you can install the latest development version from
147152

148153
pip install --pre --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pygmt
149154

150-
or from PyGMT's `GitHub repository <https://github.com/GenericMappingTools/pygmt>`__
151-
(slower as it downloads the whole archive)::
152-
153-
pip install git+https://github.com/GenericMappingTools/pygmt.git#egg=pygmt
155+
To upgrade the installed stable release or development version to be the latest
156+
one, just add ``--upgrade`` to the corresponding command above.
154157

155-
Any of the above methods (conda/pip) should allow you to use the ``pygmt``
156-
library from Python.
158+
Any of the above methods (conda/pip) should allow you to use the PyGMT package
159+
from Python.
157160

158161

159162
Testing your install
@@ -182,7 +185,8 @@ dependencies as well (be sure to have your conda environment activated)::
182185

183186
conda install pytest pytest-mpl ipython
184187

185-
Test your installation by running the following inside a Python interpreter::
188+
Test your installation by running the following inside a Python interpreter
189+
(note that it may take a few minutes)::
186190

187191
import pygmt
188192
pygmt.show_versions()
@@ -193,14 +197,14 @@ Finding the GMT shared library
193197
------------------------------
194198

195199
Sometimes, PyGMT will be unable to find the correct version of the GMT shared
196-
library.
200+
library (``libgmt``).
197201
This can happen if you have multiple versions of GMT installed.
198202

199203
You can tell PyGMT exactly where to look for ``libgmt`` by setting the
200204
``GMT_LIBRARY_PATH`` environment variable.
201205
This should be set to the directory where ``libgmt.so``, ``libgmt.dylib`` or
202-
``gmt.dll`` can be found for Linux, macOS and Windows respectively.
203-
e.g. on a command line, run::
206+
``gmt.dll`` can be found for Linux, macOS and Windows, respectively.
207+
e.g., on a command line, run::
204208

205209
# Linux/macOS
206210
export GMT_LIBRARY_PATH=$HOME/anaconda3/envs/pygmt/lib

0 commit comments

Comments
 (0)