Search code examples
numpydebian-packagingdebian-bookworm

Numpy not found in /usr/lib/python3.11, but installed in /usr/lib/python3


Not sure what happened but import numpy now fails (after Debian apt update).

$ /usr/bin/python3 -i
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'

According to strace -f it is attempting to look for numpy in /usr/lib/python3.11/dist-packages and there is no numpy package, however ...

Debian apt install python3-numpy installed that package into a different /usr/lib/python3/dist-packages directory.

I ascertained that python is from /usr/bin.

What did I do wrong?

Debian 12


Solution

  • A transient error of Debian numpy packaging in Debian 12.1.

    A simple apt update fixed this.