Open Zeitsperre opened 4 months ago
The situation here is pretty simple: In order to install raven-hydro
you must have system-level NetCDF4 libraries in order to compile the RavenHydroFramework
model (supplied by the raven-hydro
package on PyPI: https://pypi.org/project/raven-hydro/). We don't offer wheels (binaries) on PyPI since there are a lot of configurations possible (Widows/macOS/Linux * x86_64/x86/AArch64/PowerPC/etc.). Each binary has a size of around 3 MB, and space is limited on PyPI.
There's also the issue around licensing of binaries. We would need to be compiling a library that provides NetCDF4
and the RavenHydroFramework
library. Each of these have licensing specifications that we need to respect: NetCDF-C and RavenHydroFramework. In order to provide a binary for RavenHydroFramework on PyPI (via raven-hydro
), the Artistic License 2.0 asks that we add a bunch of documentation, which is feasible but is extra effort. I can open a ticket about this.
The alternative approach is to have the NetCDF4 libraries on your system already. Unidata provides some pre-built binaries of NetCDF4 (https://docs.unidata.ucar.edu/netcdf-c/current/winbin.html), but unfortunately, installing these libraries requires access to a Windows 10/11 UI (AFAIK, there are no command-line approaches to installing these libraries; believe me, I've spent many hours looking into this, but if you know of a way, please share it!).
If Anaconda Python is not available, this makes it nearly impossible to ensure Windows support in a pure Python installation is guaranteed.
All this being said, here's my suggestion:
$ nc-config
to test this).raven-hydro
: $ pip install raven-hydro
xhydro
afterwards: $ pip install xhydro
.I'm having some issues trying to install xhydro on our linux cluster because of raven-hydro. All the system dependencies are available :
But I'm having an error with raven-hydro because of scikit-build-core.
I know it would work with conda
but unfortunalety a lot of PAAS/SAAS products don't support it which is our case at the moment.
I think we should make xhydro
more pip install
friendly if possible. Is there a way that we could do with raven-hydro
what we did with xscen
to make it easier in xhydro ?
Thanks!
@sebastienlanglois
I've done my best to pin a few dependencies higher and to be a bit stricter in the expected outputs for the CMake configuration over in #56, but I'm not sure if this will fix it.
The Windows related problems I mentioned here are still an issue that I unfortunately cannot test against, but I'll have to focus on that later when I gain access to the necessary hardware.
@Zeitsperre
Thanks for the fix. This makes raven-hydro
work in linux with the proper system dependencies and xhydro
now installs correctly.
It could be interesting to test as part of xhydro
's CI/CD that a pip
installation using apt-get
to install system dependencies work as much as a conda
based installation. I wish that conda
was available everywhere but as you know, sometimes it can't be used.
This issue has been adapted from https://github.com/hydrologie/xhydro/issues/162 by @Sci-pio
Setup Information
Description
Trying to install
raven-hydro
with pip on Windows with$ pip install raven-hydro
results in an error when building the wheel:@sebastienlanglois told me the problem is fixable on Linux by running
sudo apt-get install gcc libnetcdf-dev gdal proj geos
, but that there is currently no solution for windows.Steps To Reproduce
pip install raven-hydro
Additional context
Note that I ran
$ pip install xhydro
in the cmd with Python version 3.12.3, so the problem is not related to any environment configuration.Contribution