opengeos/whitebox-python

Missing GLIBC library error with Python module

InsolublePancake opened this issue · 8 comments

  • whitebox version:2.0.0
  • Python version:3.8
  • Operating System: Scientific Linux 7.9, 'Nitrogen'

Description

I have developed a program that uses the python whitebox module on my own computer that uses Centos 8, but when I try to install on our scientific linux machines I get the following error:
./whitebox_tools: /lib64/libm.so.6: version GLIBC_2.27' not found (required by ./whitebox_tools) ./whitebox_tools: /lib64/libc.so.6: version GLIBC_2.18' not found (required by ./whitebox_tools)

What I Did

I've seen this thread, which seems to address the same issue:
(https://github.com/jblindsay/whitebox-tools/issues/112)
but the solution is for the whitebox tool and not the python module and I haven't been able to adapt it to my own situation. Is it possible, or am I barking up the wrong tree?

Thanks in advance

This issue is related to WhiteboxTools rather than whitebox-python. The error indicates that you have an outdated GLIBC library on your system. You can either update it or try it with Google Colab https://gishub.org/whitebox-colab.

Hi @giswqs, yes that is what I had understood. Unfortunately we have several machines that are on an older version of linux with these older libraries. Is there anyway I can recompile the whitebox-python so that it's compatible with the outdated GLIBC library?

Yes, you can follow the instructions here to compile WhiteboxTools from source and then replace the installed executable (path below) with the executable you compile.

/home/USER/.conda/envs/ENV/lib/python3.X/site-packages/whitebox/whitebox_tools

Thanks, I will give that a go.

@giswqs thanks for your suggestions. I have recompiled whitebox-tools and altered the python module installed in site-packages. It works perfectly on the machine that I have done this on. Do you know of anyway I can create a whitebox-python wheel with the recompiled whitebox-tools? I hoped that I could alter the whitebox-python repo by adding the recompiled file, but it doesn't seem to exist in the repo.

The python package itself does not include the executable, which is pulled automatically from whiteboxgeo.com (see https://github.com/giswqs/whitebox-python/blob/master/whitebox/whitebox_tools.py#L52) when whitebox is initialized the first time. Therefore is no plan to include the executable in the package because (1) including the executables for all three operating systems (Linux, Max, Windows) would make the package unnecessary large (2) it will make the executables decentralized and difficult to manage versions. We would prefer the executables to be hosted at a central place (e.g., whiteboxgeo.com).

One workaround is to install whitebox as usual with pip install whitebox, then you can write a python script to automatically download your compiled executable from somewhere and replace the old one.

Thank you so much for all your help. I have done something along the lines of what you suggest and it seems to be working! Many thanks :-)

Yes, you can follow the instructions here to compile WhiteboxTools from source and then replace the installed executable (path below) with the executable you compile.

/home/USER/.conda/envs/ENV/lib/python3.X/site-packages/whitebox/whitebox_tools

Hello, please help me. I have installed whiteboxgui and whitebox from pip in conda environment.

pip install whiteboxgui==0.7.0
pip install whitebox==2.1.2
  1. (replace the installed executable (path below) with the executable you compile.), I have success compiling it, but I dont know exact executable that you mean. Its that all files+folder in whitebox-compiled/target/releases?

  2. I have to see
    /media/ichsan/my_disk/Anaconda3_Linux/lib/python3.7/site-packages/whitebox/ but I dont find any folder which named whitebox_tools

  3. I tried run this

import whitebox
whitebox.__version__

it said, it was 2.1.2

but if I ran,

wbt = WhiteboxTools()
wbt.version()

it said

WhiteboxTools v2.0.0 by Dr. John B. Lindsay (c) 2017-2021

WhiteboxTools is an advanced geospatial data analysis platform developed at
the University of Guelph's Geomorphometry and Hydrogeomatics Research 
Group (GHRG). See [www.whiteboxgeo.com](http://localhost:8888/lab/tree/www.whiteboxgeo.com) for more details