Open KMIJPH opened 1 year ago
I'm also hitting issues installing the package with pip.
Reproducible example in a Docker container:
docker run -it ghcr.io/geocompx/docker:python /bin/bash
# in the container:
pip install richdem
Resulting in:
Collecting richdem
Downloading richdem-0.3.4.tar.gz (329 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 329.4/329.4 kB 3.7 MB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy<2,>=1.7 in /usr/local/lib/python3.11/site-packages (from richdem) (1.24.0)
Building wheels for collected packages: richdem
Building wheel for richdem (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [22 lines of output]
Using RichDEM hash=Unknown, time=Unknown
/usr/local/lib/python3.11/site-packages/setuptools/dist.py:771: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
warnings.warn(
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-311
creating build/lib.linux-x86_64-cpython-311/richdem
copying richdem/__init__.py -> build/lib.linux-x86_64-cpython-311/richdem
copying richdem/cli.py -> build/lib.linux-x86_64-cpython-311/richdem
running build_ext
COMPILER unix
COMPILER ARGUMENTS ['-std=c++11', '-g', '-fvisibility=hidden', '-O3', '-Wno-unknown-pragmas']
building '_richdem' extension
creating build/temp.linux-x86_64-cpython-311
creating build/temp.linux-x86_64-cpython-311/lib
creating build/temp.linux-x86_64-cpython-311/lib/richdem
creating build/temp.linux-x86_64-cpython-311/lib/richdem/common
creating build/temp.linux-x86_64-cpython-311/src
gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DDOCTEST_CONFIG_DISABLE -DRICHDEM_COMPILE_TIME=\"\\\"Unknown\\\"\" -DRICHDEM_GIT_HASH=\"\\\"Unknown\\\"\" -DRICHDEM_LOGGING -D_USE_MATH_DEFINES -Ilib/ -I/usr/local/include/python3.11 -c lib/richdem/common/random.cpp -o build/temp.linux-x86_64-cpython-311/lib/richdem/common/random.o -std=c++11 -g -fvisibility=hidden -O3 -Wno-unknown-pragmas
error: command 'gcc' failed: No such file or directory
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for richdem
Running setup.py clean for richdem
Failed to build richdem
ERROR: Could not build wheels for richdem, which is required to install pyproject.toml-based projects
[notice] A new release of pip is available: 23.1.2 -> 23.2.1
[notice] To update, run: pip install --upgrade pip
I'm also hitting issues installing the package with pip. error: command 'gcc' failed: No such file or directory
This however is related to gcc
not being found.
Thanks @KMIJPH I tried installing it again after installing gcc
and still got an error message, although a different one.
I investigated and the latest version on pypi is 0.3.4 from 2018 with a vendored older version of pybind11.
There are more recent releases: https://github.com/r-barnes/richdem/releases
If you install from source with a more recent release, it works.
Any way to get a version on pypi with a more recent version?
And how to install the more recent versions in the releases as an alternative to
pip install richdem
Many thanks.
And how to install the more recent versions in the releases
The readme has the instructions
And how to install the more recent versions in the releases
The readme has the instructions
You mean this?
I was hoping for instructions that didn't rely on git and that pointed to the releases that we can use to install the package as part of our CI workflows: https://github.com/geocompx/geocompy/blob/main/requirements.txt
See https://github.com/geocompx/geocompy/issues/191 for context, any guidance very much appreciated. Cc @michaeldorman
To build richdem, I downloaded the assets from the releases here:
https://github.com/r-barnes/richdem/releases
Then compiled richdem and then installed the python wrapper.
With apologies for newby question @snowman2, do you know commands from bash that will get that working? :pray:
In addition to the instructions, this is a helpful reference.
If compiling the code is problematic, I suggest using conda with the conda-forge channel to install richdem.
conda config --prepend channels conda-forge
conda config --set channel_priority strict
conda create -n env richdem
conda activate env
Installation on python 3.11 fails for me. I couldn't really do much with the log. On python 3.10 it installs fine.
Log: