How do I install Pandas?

The good news is I got Haiku up and running, updated software, even instlled pip.
The problem is when I run pip310 install pandas it fails with a long list of error messages? Any suggestion on how I can install pandas and other Python packages?

TX
David

2 Likes

Packages that are not “pure-Python”, as in… they need to compile code in other languages (C/C++, Fortran, etc) usually need patching to build/work OK on Haiku (unless those patches were already upstreamed).

Specially true for “big” packages (think: numpy/scipy/pandas/etc).

Thus, we usually have them available as system packages (installable with pkgman or HaikuDepot).

Apparently, our Pandas package is at version 1.3.2, and only available for Python 3.9 at the moment.

We have a pretty small pool of contributors doing most of the updates, so might take a while to get that one updated and available for Python 3.10.

Also… I see pandas needs gfortran, and we currently are facing a bug related to that (that also affects scipy, for example).

(Paging Dr. @nielx, in case he, or someone he knows, can take a look at that libgfortran.so issue)

Sorry for not being more helpful, but… that’s were we’re at at the moment: not quite ready yet for “Big Leagues” Python development.

5 Likes

Thanks for the follow up.

gfortran is available in Depot.

Yes, it is, but programs compiled with it are non-functional at the moment, unless you force them to link with libbsd.so (as the libgfortran.so needed even for the most basic “hello world” in fortran is currently missing some symbols that are defined in libbsd.so). That is what the bug I’ve mentioned previously is all about.

This in turn, causes issues with build systems that try to detect an usable fortran compiler (I encounter such an issue with meson-python while trying to updated scipy, for example).

As far as I understand it, this needs fixing on the GCC / gfortran recipes (otherwise we would need to patch everything using gfortran to add that -lbsd to the link step, a PITA).

I can’t fix it myself, due to the lack of necessary skills, so for now, I wait. GCC is a complex beast, better leave it to the experts in the house.

(edit: slightly less broken English)

You could try to patch libgfortran.so with patchelf --add-needed libbsd.so libgfortran.so. Obviously you need to port patchelf first :slight_smile:

============================================================================
Testsuite summary for patchelf 0.18.0
============================================================================
# TOTAL: 56
# PASS:  42
# SKIP:  2
# XFAIL: 0
# FAIL:  12
# XPASS: 0
# ERROR: 0

Maybe it doesn’t need mutch patching :stuck_out_tongue: :wink:

At least changing soname seems to work :wink:

/Opslag/wip/libsir/build/lib> patchelf --set-soname libsir.so.4.5.6 libsir.so 
/Opslag/wip/libsir/build/lib> readelf -d libsir.so 

Dynamic section at offset 0x174d8 contains 21 entries:
  Tag        Type                         Name/Value
 0x000000000000000e (SONAME)             Library soname: [libsir.so.4.5.6]

This too :slight_smile:

/Opslag/wip/libsir/build/lib> patchelf --add-needed libbsd.so libsir.so 
/Opslag/wip/libsir/build/lib> readelf -d libsir.so | grep NEEDED
 0x0000000000000001 (NEEDED)             Shared library: [libbsd.so]
 0x0000000000000001 (NEEDED)             Shared library: [libroot.so]
1 Like

Oh… no no no! It’s a trap!!!

I won’t be tricked into submitting a PR for GCC/gfortran using this, despite korli’s suggestion, Begasus!

I wonder how hard I would get roasted by our GCC maintainers/reviewers on such a PR :stuck_out_tongue:

I can only provide the tools (being complete or not), but lack the skills for the above, so that’s up to you @BiPolar :wink: