#1117208 python3-numpy: Can't find libblas and liblapack

Package:
libblas3
Source:
libblas3
Description:
Basic Linear Algebra Reference implementations, shared library
Submitter:
Matthias Urlichs
Date:
2025-10-05 08:47:02 UTC
Severity:
normal
Tags:
#1117208#5
Date:
2025-10-04 20:00:13 UTC
From:
To:
I had to do this:

/usr/lib/x86_64-linux-gnu$ sudo ln -s blas/libblas.so.3 .
/usr/lib/x86_64-linux-gnu$ sudo ln -s lapack/liblapack.so.3 .

... to get a plain "import numpy" to work.

#1117208#10
Date:
2025-10-04 21:42:48 UTC
From:
To:
Control: reassign -1 libblas3 3.12.1-6
Control: affects -1 + python3-numpy
Control: tags -1 + moreinfo

This sounds like a problem with the libblas.so.3 alternative. The way it
is meant to work is something like this:

/usr/lib/x86_64-linux-gnu/libblas.so.3
-> /etc/alternatives/libblas.so.3-x86_64-linux-gnu
-> /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3

and similarly

/usr/lib/x86_64-linux-gnu/liblapack.so.3
-> /etc/alternatives/liblapack.so.3-x86_64-linux-gnu
-> /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3

(but you might have a different implementation of the alternatives, like
the reference implementations libblas3 and liblapack3, which are in blas
and lapack directories instead of the openblas-pthread directory that
contains the implementation used on my system).

If I understand the overall system correctly, numpy is meant to load the
basenames libblas.so.3 and liblapack.so.3, which in practice means
/usr/lib/x86_64-linux-gnu/libblas.so.3 and
/usr/lib/x86_64-linux-gnu/liblapack.so.3, and the various
implementations of the libblas.so.3 and liblapack.so.3 virtual packages
are responsible for providing those; in which case this wouldn't be a
python3-numpy bug.

Please check /var/log/apt - has something gone wrong with those
packages' maintainer scripts on your system?

I couldn't immediately reproduce a similar bug by installing
python3-numpy, libblas3 and liblapack3 into a debian:sid-slim podman
container.

     smcv

#1117208#25
Date:
2025-10-05 07:57:40 UTC
From:
To:
Ah, so that's the clue I was missing.

# update-alternatives --query libblas.so.3-x86_64-linux-gnu
update-alternatives: warning: alternative
/usr/lib/x86_64-linux-gnu/atlas/libblas.so.3 (part of link group
libblas.so.3-x86_64-linux-gnu) doesn't exist; removing from list of
alternatives
Name: libblas.so.3-x86_64-linux-gnu
Link: /usr/lib/x86_64-linux-gnu/libblas.so.3
Status: auto
Best: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3
Value: /usr/lib/x86_64-linux-gnu/atlas/libblas.so.3

Alternative: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3
Priority: 10

So what actually happened seems to be that atlas, upon deinstallation,
somehow failed to remove its alternative correctly ..?