You are not logged in.

#1 2019-12-21 21:28:27

Registered: 2017-11-25
Posts: 17

[SOLVED] python-numpy only works with openblas

For an OpenCV installation, I want to use atlas as BLAS implementation. There is not atlas package for BLAS on the official repositories, so I installed it from AUR (atlas-lapack).

I also installed python-numpy from the official repositories. I could have installed it with pip or anaconda but the archwiki recomends otherwise.

With this setup, I installed opencv from source, with Atlas for BLAS implementation and python3.8 bindings. However, `import cv2` failed with this error:

Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "cv2/", line 8, in <module>
   import numpy
   File "/usr/lib/python2.7/site-packages/numpy/", line 145, in <module>
   from . import lib
   File "/usr/lib/python2.7/site-packages/numpy/lib/", line 9, in <module>
   from .index_tricks import *
   File "/usr/lib/python2.7/site-packages/numpy/lib/", line 13, in <module>
   import numpy.matrixlib as matrixlib
   File "/usr/lib/python2.7/site-packages/numpy/matrixlib/", line 6, in <module>
   from .defmatrix import *
   File "/usr/lib/python2.7/site-packages/numpy/matrixlib/", line 13, in <module>
   from numpy.linalg import matrix_power
   File "/usr/lib/python2.7/site-packages/numpy/linalg/", line 51, in <module>
   from .linalg import *
   File "/usr/lib/python2.7/site-packages/numpy/linalg/", line 35, in <module>
   from numpy.linalg import lapack_lite, _umath_linalg
ImportError: cannot open shared object file: No such file or directory

From this log I infer that numpy requires openblas. This requirement is not possible to fulfil because it would conflict with atlas. So I am forced either to remove atlas and use openblas or install numpy with anaconda, which is discouraged by the wiki.

IMHO one of these things should be done:
- Allow python-numpy package to link against atlas library if it is available
- Create a python-numpy package that links agains atlas library
- Change the text in the python packaging guideline so that it encourages pip or anaconda as python packages managers.

Maybe the three of them :)

Perhaps I'm missing something, could anyone give me a hand?

Last edited by capstayn (2019-12-22 09:42:14)


#2 2019-12-21 23:40:31

From: Spain
Registered: 2011-10-09
Posts: 2,123

Re: [SOLVED] python-numpy only works with openblas

No, numpy doesn't depend on openblas. In fact, there is nothing in our repos that links to, so this dependency comes from something you have installed from outside the official repos. Running 'lddtree /usr/lib/python2.7/site-packages/numpy/linalg/' may give you some hint.


#3 2019-12-22 09:34:32

Registered: 2017-11-25
Posts: 17

Re: [SOLVED] python-numpy only works with openblas

Yep, you are right. The error seems to come from atlas-lapack. Thanks for the tip.


Board footer

Powered by FluxBB