Skip to content

Commit 3df1e5d

Browse files
Issue #376 Shorten and simplify documentation about dev install on Windows
1 parent 78a709f commit 3df1e5d

File tree

1 file changed

+13
-114
lines changed

1 file changed

+13
-114
lines changed

docs/development.rst

Lines changed: 13 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -270,128 +270,27 @@ Normally you can install the client the same way on Windows as on Linux, like so
270270
pip install -e .[dev]
271271
272272
This should be working with the most recent code, however, in the past we sometimes had issues with a development installation.
273-
Should you experience problems, then this section describes some ways to solve them.
274273

275-
Known issue
276-
-----------
274+
Should you experience problems, there is also a conda package for the Python client and that should be the easiest solution.
277275

278-
The specific problem we experienced on Windows is that the geopandas Python package depends on a few libraries that are a bit trickier to install.
279-
They need some compiled C/C++ code and unfortunately these libraries do not provide officially supported python wheels for Windows.
276+
For development, what you need to do is:
280277

281-
Root Cause
282-
~~~~~~~~~~
283-
284-
Down the line geopandas depends on GDAL and that is a C++ library that does not provide *official* binaries for Windows, though there are binaries from other sources.
285-
286-
Because there isn't a supported binary or a Python wheel, the pip installation process will fall back to compiling the C libraries on the fly.
287-
But that will only work if your have set up a C++ compiler, and have all the dependencies installed,
288-
and setting up all the dependencies needed for these binaries can be a bit of work.
289-
290-
Below are some easier solutions.
291-
292-
Solutions
293-
---------
294-
295-
These are a few solutions we know, from the easiest option at the top to the most complex at the bottom.
296-
The first two options are described in more detail in the sections below.
297-
298-
1. **Recommended option:** install the client in a conda environment.
299-
300-
For most people this would be the simplest solution.
301-
302-
See: :ref:`windows-dev-install-with-conda`
303-
304-
2. Use unofficial python wheels for GDAL and Fiona.
305-
306-
This is only suitable for development, not for production.
307-
308-
See: :ref:`windows-dev-install-unofficial-wheels`
309-
310-
3. If you already use Docker or WSL2, using either of those is also a good option for you.
311-
312-
- Then you will be on Linux in a container or the WSL VM.
313-
- Installation on WSL should be the same as on native Linux.
314-
- If you are comfortable with creating your own Dockerfiles then Docker is also an option.
315-
316-
4. Install a C++ compiler and deal with the compilation issues when you install it via pip.
317-
318-
Can be complex, so your mileage may vary.
319-
320-
321-
322-
.. _windows-dev-install-with-conda:
323-
324-
Option 1) Install the client in a conda environment
325-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
326-
327-
The simplest way to install your openeo development setup is to use the conda package manager, either via Anaconda, or via Miniforge.
328-
329-
Anaconda is a commercial product and you can buy support for it.
330-
Miniforge is a fully open source alternative that has a drop-in replacement for the conda command.
331-
Miniforge uses the `Conda-forge <https://conda-forge.org/>`_ channel (which is a package repository) by default.
332-
333-
* `Anaconda <https://anaconda.org/>`_
334-
* `Miniforge on GitHub <https://github.com/conda-forge/miniforge>`_
335-
* `Conda-forge <https://conda-forge.org/>`_
336-
337-
The instructions below should work in both Anaconda and Miniforge.
338-
Though with Miniforge you can simplify the commands a little bit because the conda-forge channel is the default, so you can leave out the option ``-c conda-forge``.
339-
340-
Create a conda environment with the geopandas package already installed.
341-
Installing geopandas from a conda package is the step that avoids the hard part.
278+
1. Create and activate a new conda environment for developing the openeo-python-client.
279+
2. In that conda environment, install only the dependencies of openeo via conda, but not the openeo package itself.
280+
3. Do a pip install of the code in *editable mode* with `pip -e`.
342281

343282
.. code-block:: console
344283
345-
conda create -n <your environment's name> geopandas
346-
347-
# for example
348-
conda create -n openeopyclient geopandas
349-
350-
Activate the conda environment
284+
conda create -n <your environment's name>
351285
352-
.. code-block:: console
286+
# For example:
287+
conda create -n openeopyclient
353288
289+
# Activate the conda environment
354290
conda activate openeopyclient
355291
356-
Next, run the dev install with pip
357-
358-
In the directory where you git-cloned the openEO Python client:
359-
360-
.. code-block:: console
361-
362-
python -m pip install -e .[dev]
363-
364-
A quick way to check whether the client was successfully installed or not is to print its version number.
365-
366-
In your conda environment, launch the Python interpreter and try the following snippet of Python code to show the client's version:
367-
368-
.. code-block:: python
369-
370-
import openeo
292+
# Install openeo from the conda-forge channel
293+
conda install --only-deps -c conda-forge openeo
371294
372-
print(openeo.client_version())
373-
374-
375-
.. _windows-dev-install-unofficial-wheels:
376-
377-
Option 2) Use some unofficial python wheels for GDAL and Fiona
378-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
379-
380-
There are `unofficial Python wheels at https://www.lfd.uci.edu/~gohlke/pythonlibs/: <https://www.lfd.uci.edu/~gohlke/pythonlibs/>`_
381-
382-
But as the name says, these wheels have no official support, so they are not recommended for production.
383-
They can however help you out for a development environment.
384-
385-
You need to install the wheels for GDAL and Fiona.
386-
387-
* wheels for `Fiona <https://www.lfd.uci.edu/~gohlke/pythonlibs#fiona>`_
388-
* wheels for `GDAL <https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal>`_
389-
390-
.. code-block::
391-
392-
# In your activate virtualenv
393-
# install the wheels:
394-
pip install <path to GDAL whl file> <path to fiona whl file>
395-
396-
# And then the regular developer installation command.
397-
python -m pip install -e .[dev]
295+
# Now install the openeo code in editable mode.
296+
pip install -e .[dev]

0 commit comments

Comments
 (0)