@@ -29,22 +29,22 @@ doesn't interfere with any other Python installations in your system.
29
29
Which GMT?
30
30
----------
31
31
32
- You'll need GMT6 , the latest development version available from
32
+ You'll need GMT 6 , the latest development version available from
33
33
`the GitHub repository <https://github.com/GenericMappingTools/gmt >`__.
34
34
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 >`__.
39
38
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/ >`__.
43
42
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,
45
45
which is untested and we would love to get feedback from anyone who tries.
46
46
47
- We recommend following the instructions further on to install GMT6 .
47
+ We recommend following the instructions further on to install GMT 6 .
48
48
49
49
50
50
Dependencies
@@ -55,42 +55,40 @@ GMT/Python requires the following libraries:
55
55
* `numpy <http://www.numpy.org/ >`__
56
56
* `pandas <https://pandas.pydata.org/ >`__
57
57
* `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.
58
63
59
64
60
65
Installing GMT and other dependencies
61
66
-------------------------------------
62
67
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.
65
70
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 >`__
68
73
to avoid issues with competing versions of GMT and its dependencies.
69
74
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) ::
72
77
73
- conda config --add channels conda-forge
78
+ conda config --prepend channels conda-forge/label/dev
79
+ conda config --prepend channels conda-forge
74
80
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
76
82
(we'll call it ``gmt-python `` but you can change it to whatever you want)::
77
83
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*
79
85
80
86
Activate the environment by running::
81
87
82
88
source activate gmt-python
83
89
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.
94
92
95
93
.. note ::
96
94
@@ -125,10 +123,10 @@ Testing your install
125
123
--------------------
126
124
127
125
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)::
130
128
131
- conda install pytest pytest-mpl ipython
129
+ conda install pytest pytest-mpl sphinx jinja2 docutils ipython
132
130
133
131
Test your installation by running the following inside a Python interpreter::
134
132
@@ -139,19 +137,21 @@ Test your installation by running the following inside a Python interpreter::
139
137
Finding the GMT shared library
140
138
------------------------------
141
139
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.
144
143
145
144
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.
150
150
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::
153
153
154
154
export GMT_LIBRARY_PATH=$HOME/anaconda3/envs/gmt-python/lib
155
155
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