Skip to content

Commit 76324d8

Browse files
authored
Update install docs (#206)
* General improvements to the installation instructions * Add an additional installation method (coda+pip) if creating the environment using conda fails.
1 parent 6d9f0d8 commit 76324d8

File tree

2 files changed

+46
-25
lines changed

2 files changed

+46
-25
lines changed

CONTRIBUTING.rst

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,34 @@ Conda quickly installs, runs and updates packages and their dependencies.
6363
It also allows to easily create, save, load and switch between different
6464
environments on your local computer.
6565

66-
The developer environment can be created using the
66+
Before continuing, Mac OSX users also need to install a more recent compiler.
67+
See instructions here: :ref:`OSX users <install_osx_users>`.
68+
69+
The developer environment can be created from the file
6770
`environment_dev.yml <https://github.com/pySTEPS/pysteps/blob/master/environment_dev.yml>`_
68-
file in the project's root directory running the command::
71+
in the project's root directory by running the command::
6972

7073
conda env create -f environment_dev.yml
7174

7275
This will create the **pysteps_dev** environment that can be activated using::
7376

7477
conda activate pysteps_dev
7578

76-
Once the environment is created, the package can be installed in development
77-
mode, in such a way that the project appears to be installed,
78-
but yet is still editable from the source tree.
79-
See instructions in the :ref:`Installing pysteps <development_mode_install>`
80-
section.
79+
Once the environment is activated, the latest version of pysteps can be installed
80+
in development mode, in such a way that the project appears to be installed,
81+
but yet is still editable from the source tree::
82+
83+
pip install -e <path to local pysteps repo>
84+
85+
To test if the installation went fine, you can try launching Python and importing
86+
pysteps :ref:`Import pysteps <_import_pysteps>`.
87+
88+
**Note**: In case of installation or import errors, you can remove the pysteps_dev environment
89+
and try starting from an empty environment (adapt the Python version as needed)::
90+
91+
conda create -n pysteps_dev python=3.8
8192

93+
You can then activate it and install pysteps with pip as exaplained above.
8294

8395
Fork the repository
8496
~~~~~~~~~~~~~~~~~~~

doc/source/user_guide/install_pysteps.rst

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ Other optional dependencies include:
3838
* `pandas <https://pandas.pydata.org/>`_ and
3939
`scikit-image <https://scikit-image.org/>`_ (for more advanced feature tracking)
4040

41-
41+
**Important**: If you only want to use pysteps, you can continue reading below.
42+
But, if you want to contribute to pysteps or edit the package, you need to install
43+
pysteps in development mode: :ref:`Contributing to pysteps <contributor_guidelines>`.
4244

4345
Anaconda install (recommended)
4446
------------------------------
@@ -88,9 +90,10 @@ to adhere to the [PEP517 standards](https://www.python.org/dev/peps/pep-0517/).
8890
Using `pip` instead of `setup.py` guarantees that all the package dependencies
8991
are properly handled during the installation process.
9092

93+
.. _install_osx_users:
9194

92-
OSX users
93-
~~~~~~~~~
95+
OSX users: gcc compiler
96+
~~~~~~~~~~~~~~~~~~~~~~~
9497

9598
pySTEPS uses Cython extensions that need to be compiled with multi-threading
9699
support enabled. The default Apple Clang compiler does not support OpenMP.
@@ -131,15 +134,15 @@ the homebrew installation. For example::
131134

132135
Then, you can continue with the normal installation procedure described next.
133136

134-
Installation
135-
~~~~~~~~~~~~
137+
Installation using pip
138+
~~~~~~~~~~~~~~~~~~~~~~
136139

137140
The latest pysteps version in the repository can be installed using pip by
138141
simply running in a terminal::
139142

140143
pip install git+https://github.com/pySTEPS/pysteps
141144

142-
Or, from a local copy of the repo (global installation)::
145+
Or, from a local copy of the repo::
143146

144147
git clone https://github.com/pySTEPS/pysteps
145148
cd pysteps
@@ -148,18 +151,6 @@ Or, from a local copy of the repo (global installation)::
148151
The above commands install the latest version of the **master** branch,
149152
which is continuously under development.
150153

151-
.. _development_mode_install:
152-
153-
Development mode
154-
################
155-
156-
The latest version can also be installed in Development Mode, i.e.,
157-
in such a way that the project appears to be installed,
158-
but yet is still editable from the source tree::
159-
160-
pip install -e <path to local pysteps repo>
161-
162-
163154
Setting up the user-defined configuration file
164155
----------------------------------------------
165156

@@ -177,6 +168,24 @@ that can be accessed as attributes or as items.
177168
Set-up the user-defined configuration file <set_pystepsrc>
178169
Example pystepsrc file <pystepsrc_example>
179170

171+
.. _import_pysteps:
172+
173+
Final test: import pysteps in Python
174+
------------------------------------
175+
176+
Activate the pysteps environment::
177+
178+
conda activate pysteps
179+
180+
Launch Python and import pysteps::
181+
182+
python
183+
>>> import pysteps
184+
185+
**Important**: The Python interpreter must be launched outside of the pysteps directory.
186+
Otherwise, it confuses the name of the directory with the package name.
187+
See :ref:`Issue 40 <https://github.com/pySTEPS/pysteps/issues/40>`.
188+
180189

181190

182191

0 commit comments

Comments
 (0)