Skip to content

Commit c4708e0

Browse files
authored
Update the install instructions (GenericMappingTools#230)
Includes the packaging dependency and IPython listed as optional. Create the environment and install dependencies in a single command. Set the conda channel preference order before anything else. Include sphinx and docutils as testing dependencies (GenericMappingTools#226).
1 parent ee820aa commit c4708e0

File tree

1 file changed

+42
-42
lines changed

1 file changed

+42
-42
lines changed

doc/install.rst

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@ doesn't interfere with any other Python installations in your system.
2929
Which GMT?
3030
----------
3131

32-
You'll need GMT6, the latest development version available from
32+
You'll need GMT 6, the latest development version available from
3333
`the GitHub repository <https://github.com/GenericMappingTools/gmt>`__.
3434

35-
We need GMT6 since there are many changes to the API in response to
36-
the development of GMT/Python, especially the
37-
`modern mode <http://gmt.soest.hawaii.edu/projects/gmt/wiki/Modernization>`__
38-
introduced in GMT6.
35+
We need the very latest GMT since there are many changes being made to the C API in
36+
response to the development of GMT/Python, mainly the new
37+
`modern execution mode <http://gmt.soest.hawaii.edu/projects/gmt/wiki/Modernization>`__.
3938

40-
GMT6 is **NOT** officially released yet. However, we provide conda packages
41-
of GMT6 for Linux and macOS, which are available through
42-
`conda-forge <https://github.com/conda-forge/gmt-feedstock/>`__.
39+
**GMT 6 has not been officially released** yet.
40+
However, we provide compiled conda packages of the development version for Linux and Mac
41+
through `conda-forge <https://github.com/conda-forge/gmt-feedstock/>`__.
4342
You can also
44-
`build GMT from source <http://gmt.soest.hawaii.edu/projects/gmt/wiki/BuildingGMT>`__ instead,
43+
`build GMT from source <http://gmt.soest.hawaii.edu/projects/gmt/wiki/BuildingGMT>`__
44+
instead,
4545
which is untested and we would love to get feedback from anyone who tries.
4646

47-
We recommend following the instructions further on to install GMT6.
47+
We recommend following the instructions further on to install GMT 6.
4848

4949

5050
Dependencies
@@ -55,42 +55,40 @@ GMT/Python requires the following libraries:
5555
* `numpy <http://www.numpy.org/>`__
5656
* `pandas <https://pandas.pydata.org/>`__
5757
* `xarray <http://xarray.pydata.org/>`__
58+
* `packaging <https://pypi.org/project/packaging/>`__
59+
60+
The following are optional (but recommended) dependencies:
61+
62+
* `IPython <https://ipython.org/>`__: For embedding the figures in Jupyter notebooks.
5863

5964

6065
Installing GMT and other dependencies
6166
-------------------------------------
6267

63-
Before installing GMT/Python,
64-
we must install GMT itself along with the other dependencies.
68+
Before installing GMT/Python, we must install GMT itself along with the other
69+
dependencies.
6570
The easiest way to do this is using the ``conda`` package manager.
66-
We recommend working in an isolated `conda environment
67-
<https://conda.io/docs/user-guide/tasks/manage-environments.html>`__
71+
We recommend working in an isolated
72+
`conda environment <https://conda.io/docs/user-guide/tasks/manage-environments.html>`__
6873
to avoid issues with competing versions of GMT and its dependencies.
6974

70-
First, we must configure conda to get packages from the `conda-forge
71-
channel <https://conda-forge.org/>`__::
75+
First, we must configure conda to get packages from the
76+
`conda-forge channel <https://conda-forge.org/>`__ (the order is important)::
7277

73-
conda config --add channels conda-forge
78+
conda config --prepend channels conda-forge/label/dev
79+
conda config --prepend channels conda-forge
7480

75-
Now we can create a conda environment with only Python and ``pip`` installed
81+
Now we can create a new conda environment with Python and all our dependencies installed
7682
(we'll call it ``gmt-python`` but you can change it to whatever you want)::
7783

78-
conda create --name gmt-python python=3.6 pip
84+
conda create --name gmt-python python=3.6 pip numpy pandas xarray packaging ipython gmt=6.0.0*
7985

8086
Activate the environment by running::
8187

8288
source activate gmt-python
8389

84-
From now on, all ``conda`` and ``pip`` commands will take place inside the
85-
environment and won't affect your default installation.
86-
87-
Install the latest version of GMT 6::
88-
89-
conda install gmt -c conda-forge/label/dev
90-
91-
And finally, install the rest of the dependencies::
92-
93-
conda install numpy pandas xarray
90+
From now on, all commands will take place inside the environment and won't affect your
91+
default installation.
9492

9593
.. note::
9694

@@ -125,10 +123,10 @@ Testing your install
125123
--------------------
126124

127125
GMT/Python ships with a full test suite.
128-
You can run our tests after you install it but you will need a few extra
129-
dependencies as well (be sure to have your conda env activated)::
126+
You can run our tests after you install it but you will need a few extra dependencies as
127+
well (be sure to have your conda env activated)::
130128

131-
conda install pytest pytest-mpl ipython
129+
conda install pytest pytest-mpl sphinx jinja2 docutils ipython
132130

133131
Test your installation by running the following inside a Python interpreter::
134132

@@ -139,19 +137,21 @@ Test your installation by running the following inside a Python interpreter::
139137
Finding the GMT shared library
140138
------------------------------
141139

142-
Sometimes, GMT/Python will be unable to find the correct version of the GMT
143-
shared library. This can happen if you have multiple versions of GMT installed.
140+
Sometimes, GMT/Python will be unable to find the correct version of the GMT shared
141+
library.
142+
This can happen if you have multiple versions of GMT installed.
144143

145144
You can tell GMT/Python exactly where to look for ``libgmt`` by setting the
146-
``GMT_LIBRARY_PATH`` environment variable. This should be set to the directory
147-
where ``libgmt.so`` (or ``.dylib``) is found. **Only use this as a last
148-
resort**. Setting the path in this way means that GMT/Python will not be able
149-
to easily find the correct ``libgmt`` when you're changing conda environments.
145+
``GMT_LIBRARY_PATH`` environment variable.
146+
This should be set to the directory where ``libgmt.so`` (or ``.dylib``) is found.
147+
**Only use this as a last resort**.
148+
Setting the path in this way means that GMT/Python will not be able to easily find the
149+
correct ``libgmt`` when you're changing conda environments.
150150

151-
If you installed GMT using conda using the instructions above and you're using
152-
Linux or Mac, place the following in your ``~/.bashrc`` file::
151+
If you installed GMT using conda and the instructions above, place the following in your
152+
``~/.bashrc`` file::
153153

154154
export GMT_LIBRARY_PATH=$HOME/anaconda3/envs/gmt-python/lib
155155

156-
You should change ``$HOME/anaconda3`` to wherever you installed Anaconda (this
157-
is the default for Linux).
156+
You should change ``$HOME/anaconda3`` to wherever you installed Anaconda (this is the
157+
default for Linux).

0 commit comments

Comments
 (0)