问题
I'm on an Ubuntu 14.04.
I would have expected doing:
sudo apt-get install python-numpy
would've worked but it isn't the case...
The way I tried to check is by doing locate blas
and found nothing that seemed relevant.
I would like a solution that doesn't involve me compiling from source.
The ideal solution is something that uses the ubuntu repos.
回答1:
In Ubuntu 14.04 and later, blas and lapack are installed as part of python-scipy and python3-scipy, so you need to install python-scipy. Open the terminal and type:
sudo apt install python-scipy
This command will also install libblas3 (Basic Linear Algebra Subprograms reference implementations, shared library) and liblapack3 (Library of linear algebra routines 3 - shared version) as dependencies, and it will also install python-numpy as a dependency if you don't already have it installed.
回答2:
Have your tried to use pip?
sudo pip install numpy
If you dont have pip install pip with instructions here
回答3:
I have very good experience with the anaconda package manager (learning took me 1-2h). In my opinion it is easier to use than venv and more felixble than pip/env alone. After download and setup you have most of the package like numpy ready to go. So no problems like this anymore!
回答4:
numpy.show_config()
revealed that I had no BLAS support even though python3-scipy
was already installed. Uninstalling and re-installing python3-scipy
and python3-numpy
fixed it:
sudo apt-get remove python3-scipy python3-numpy
sudo apt-get install python3-scipy pthon3-numpy
Now I have LAPACK/BLAS support:
>>> numpy.show_config()
openblas_lapack_info:
NOT AVAILABLE
mkl_info:
NOT AVAILABLE
atlas_3_10_blas_threads_info:
NOT AVAILABLE
lapack_info:
libraries = ['lapack', 'lapack']
language = f77
library_dirs = ['/usr/lib']
atlas_3_10_blas_info:
NOT AVAILABLE
openblas_info:
NOT AVAILABLE
blas_opt_info:
libraries = ['blas', 'blas']
define_macros = [('NO_ATLAS_INFO', 1), ('HAVE_CBLAS', None)]
library_dirs = ['/usr/lib']
language = c
blas_info:
libraries = ['blas', 'blas']
language = c
library_dirs = ['/usr/lib']
define_macros = [('HAVE_CBLAS', None)]
blas_mkl_info:
NOT AVAILABLE
atlas_info:
NOT AVAILABLE
atlas_3_10_threads_info:
NOT AVAILABLE
lapack_mkl_info:
NOT AVAILABLE
atlas_blas_threads_info:
NOT AVAILABLE
atlas_3_10_info:
NOT AVAILABLE
atlas_threads_info:
NOT AVAILABLE
atlas_blas_info:
NOT AVAILABLE
lapack_opt_info:
libraries = ['lapack', 'lapack', 'blas', 'blas']
define_macros = [('NO_ATLAS_INFO', 1), ('HAVE_CBLAS', None)]
library_dirs = ['/usr/lib']
language = c
来源:https://stackoverflow.com/questions/26942148/what-is-the-easiest-way-to-install-numpy-with-lapack-blas