7

Problem: Linking numpy to correct Linear Algebra libraries. Process is so complicated that I might be looking for the solution 6th time and I have no idea whats going wrong. I am on Ubuntu 12.04.5. I reinstalled blas and lapack and then reinstalled numpy using pip. I did that in system environment and then also tried in virtualenv environment. None of the things seem to be working.

Here is my numpy.__config__.show():

lapack_info:
  NOT AVAILABLE
lapack_opt_info:
  NOT AVAILABLE
openblas_lapack_info:
  NOT AVAILABLE
blas_info:
  NOT AVAILABLE
atlas_3_10_blas_threads_info:
  NOT AVAILABLE
atlas_threads_info:
  NOT AVAILABLE
blas_src_info:
  NOT AVAILABLE
atlas_3_10_threads_info:
  NOT AVAILABLE
atlas_blas_info:
  NOT AVAILABLE
atlas_3_10_blas_info:
  NOT AVAILABLE
lapack_src_info:
  NOT AVAILABLE
atlas_blas_threads_info:
  NOT AVAILABLE
openblas_info:
  NOT AVAILABLE
blas_mkl_info:
  NOT AVAILABLE
blas_opt_info:
  NOT AVAILABLE
atlas_info:
  NOT AVAILABLE
atlas_3_10_info:
  NOT AVAILABLE
lapack_mkl_info:
  NOT AVAILABLE
mkl_info:
  NOT AVAILABLE

This is a very common error and has lots of solution depending on the user's environment and history. I recently went through the whole process of installing BLAS and LAPACK as instructed here: https://stackoverflow.com/a/9173550/3413239. I was able to successfully install both.

However, I initially had these libraries: (ls /usr/lib | grep blas)

libopenblas.so.0
openblas-base/
libblas.so.3gf
libblas.3

How should I link my numpy to linear algebra libraries. Is it mandatory to have all the linaear algebra libraries? i.e. lapack, blas, atlas?

I am assuming once the numpy is linked all other modules like scipy and Orange will work.

Community
  • 1
  • 1
pg2455
  • 5,039
  • 14
  • 51
  • 78
  • 3
    See here: http://stackoverflow.com/q/21671040/1461210. Also it's probably overkill to build the BLAS/LAPACK libraries from source since they're available from the standard Ubuntu repos (`sudo apt-get install libopenblas-dev` etc.). – ali_m Nov 13 '15 at 14:57

4 Answers4

11

It's possible that you have unmet dependencies. When I had this error, I was able to fix it by installing two packages:

sudo apt-get install libblas-dev  liblapack-dev
Toby Speight
  • 27,591
  • 48
  • 66
  • 103
Stephen
  • 238
  • 2
  • 6
  • 2
    I understand this question is Ubuntu specific, but would you happen to know how to solve this same issue with Windows? – ChickenFeet Nov 07 '18 at 10:41
3

Install following libraries (Ubuntu 20.04):

sudo apt-get install libatlas-base-dev libblas3 liblapack3 liblapack-dev libblas-dev gfortran

and then install python packages using pip.

Arun
  • 421
  • 3
  • 6
1

If anyone has a similar issue with Scipy installation on FreeBSD - it can be fixed quite simply by installing necessary packages on the system itself using pkg command:

pkg install blas
pkg install lapack
Pingolin
  • 3,161
  • 6
  • 25
  • 40
Rocckk
  • 406
  • 1
  • 5
  • 9
0

Link existing Numpy to Libraries: Link ATLAS/MKL to an installed Numpy

Compile Numpy with OpenBlas: Compiling numpy with OpenBLAS integration

Community
  • 1
  • 1
pg2455
  • 5,039
  • 14
  • 51
  • 78