Scipy installation issue, getting ImportError: libopenblas.so.0: cannot open shared object file or directory

16,541

Solution 1

You have to install OpenBlas system library. Try:

sudo apt-get install libopenblas-dev

Solution 2

Firstly, try locate libopenblas.so.0 to find out the path.

Then, do echo $LD_LIBRARY_PATH to check if it has been included.

Share:
16,541
Admin
Author by

Admin

Updated on June 06, 2022

Comments

  • Admin
    Admin almost 2 years

    I am installing Scipy-0.16.1 on Ubuntu 14.04

    OpenBLAS_0.2.18 and Numpy-1.11.0 have been installed with no issues.

    Scipy-0.16.1.tar.gz has been downloaded

    site.cfg was copied and un-commented the following lines:

    [openblas]
    
    libraries = openblas
    
    library_dirs = /opt/OpenBLAS/lib
    
    include_dirs = /opt/OpenBLAS/include
    

    Added a line to ~/.bashrc

    export LD_LIBRARY_PATH=/opt/OpenBLAS/lib:$LD_LIBRARY_PATH
    

    source ~/.bashrc

    ldconfig

    sudo python setup.py config

    ERROR

    ImportError: libopenblas.so.0: cannot open shared object file: No such file or directory

  • Francesco Nazzaro
    Francesco Nazzaro about 8 years
    try export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH before run setup.py
  • Francesco Nazzaro
    Francesco Nazzaro about 8 years
    or you can try to install scipy with pip install scipy==0.16.1
  • Admin
    Admin about 8 years
    I tried export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH and run sudo python setup.py config , it still shows same error
  • Francesco Nazzaro
    Francesco Nazzaro about 8 years
    try to install with pip
  • Admin
    Admin about 8 years
    I tried pip install scipy and get Requirement already satisfied (use --upgrad to upgrade): script in /usr/lib/python2.7/dist-packages
  • Francesco Nazzaro
    Francesco Nazzaro about 8 years
    it seems that you already have scipy installed. try to open a python shell and try import scipy
  • Jacques MALAPRADE
    Jacques MALAPRADE almost 2 years
    In centos use: dnf install openblas-devel