Windows Scipy Install: No Lapack/Blas Resources Found
Asked Answered
C

17

179

I am trying to install python and a series of packages onto a 64bit windows 7 desktop. I have installed Python 3.4, have Microsoft Visual Studio C++ installed, and have successfully installed numpy, pandas and a few others. I am getting the following error when trying to install scipy;

numpy.distutils.system_info.NotFoundError: no lapack/blas resources found

I am using pip install offline, the install command I am using is;

pip install --no-index --find-links="S:\python\scipy 0.15.0" scipy

I have read the posts on here about requiring a compiler which if I understand correctly is the VS C++ compiler. I am using the 2010 version as I am using Python 3.4. This has worked for other packages.

Do I have to use the window binary or is there a way I can get pip install to work?

Many thanks for the help

Compile answered 28/1, 2015 at 11:0 Comment(7)
I think it requires a Fortran compiler. But if pre-built binaries are acceptable, you can use Christoph Gohlke's numpy and scipy wheel packages with pip.Barefaced
Thanks Eryksun, I'm getting the binaries downloaded to see if that fixes the problem.Compile
Frustratingly when i try and install the binary it claims that I do not have Python 3.4 installed, even though it is there in PATH.Compile
Try py -3.4 -m pip install SomePackage.whlBarefaced
I also had this problem. I was unable to get pip to work, but this worked for me (on Widows): sourceforge.net/projects/scipy/files/scipyPeach
Answered: https://mcmap.net/q/67538/-what-is-the-easiest-way-to-install-blas-and-lapack-for-scipyWarrantable
pip install numpy mkl before scipyAdriel
K
36

The solution to the absence of BLAS/LAPACK libraries for SciPy installations on Windows 7 64-bit is described here:

http://www.scipy.org/scipylib/building/windows.html

Installing Anaconda is much easier, but you still don't get Intel MKL or GPU support without paying for it (they are in the MKL Optimizations and Accelerate add-ons for Anaconda - I'm not sure if they use PLASMA and MAGMA either). With MKL optimization, numpy has outperformed IDL on large matrix computations by 10-fold. MATLAB uses the Intel MKL library internally and supports GPU computing, so one might as well use that for the price if they're a student ($50 for MATLAB + $10 for the Parallel Computing Toolbox). If you get the free trial of Intel Parallel Studio, it comes with the MKL library, as well as C++ and FORTRAN compilers that will come in handy if you want to install BLAS and LAPACK from MKL or ATLAS on Windows:

http://icl.cs.utk.edu/lapack-for-windows/lapack/

Parallel Studio also comes with the Intel MPI library, useful for cluster computing applications and their latest Xeon processsors. While the process of building BLAS and LAPACK with MKL optimization is not trivial, the benefits of doing so for Python and R are quite large, as described in this Intel webinar:

https://software.intel.com/en-us/articles/powered-by-mkl-accelerating-numpy-and-scipy-performance-with-intel-mkl-python

Anaconda and Enthought have built businesses out of making this functionality and a few other things easier to deploy. However, it is freely available to those willing to do a little work (and a little learning).

For those who use R, you can now get MKL optimized BLAS and LAPACK for free with R Open from Revolution Analytics.

EDIT: Anaconda Python now ships with MKL optimization, as well as support for a number of other Intel library optimizations through the Intel Python distribution. However, GPU support for Anaconda in the Accelerate library (formerly known as NumbaPro) is still over $10k USD! The best alternatives for that are probably PyCUDA and scikit-cuda, as copperhead (essentially a free version of Anaconda Accelerate) unfortunately ceased development five years ago. It can be found here if anybody wants to pick up where they left off.

Kraemer answered 25/4, 2015 at 2:56 Comment(6)
The only problem with icl.cs.utk.edu/lapack-for-windows/lapack is that it's confusing. Anyone have tips on what to do with it?Indecipherable
Short answer: use AnacondaInstallation
I use Anaconda and I still get the error. I had to download the whl file including mkl and install it to get it to work. (See Jaanus' answer below: vanilla numpy is not enough)Berdichev
2017 here - I got it working using the method here. It's not too bad once you understand but it's not as straightforward as it should be.Cameliacamella
The first link is broken. I think it should be scipy.github.io/devdocs/building/windows.html instead.Gearbox
Look here for conda numpy with openblas on windows.Scalping
M
125

The following link should solve all problems with Windows and SciPy; just choose the appropriate download. I was able to pip install the package with no problems. Every other solution I have tried gave me big headaches.

Source: http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy

Command:

 pip install [Local File Location]\[Your specific file such as scipy-0.16.0-cp27-none-win_amd64.whl]

This assumes you have installed the following already:

  1. Install Visual Studio 2015/2013 with Python Tools
    (Is integrated into the setup options on install of 2015)

  2. Install Visual Studio C++ Compiler for Python
    Source: http://www.microsoft.com/en-us/download/details.aspx?id=44266
    File Name: VCForPython27.msi

  3. Install Python Version of choice
    Source: python.org
    File Name (e.g.): python-2.7.10.amd64.msi

Meyeroff answered 18/8, 2015 at 5:36 Comment(8)
Installation of scipy worked, but none of the subpackages work. For example from scipy import interpolation results in errors comming from a blas.pyDisposure
@Nozdrum and those who want to use that method, you simply need to install numpy+mkl before scipy to have access to blas.Thorndike
Also, you may want to use the SciPy install from the same site pointed to by @Holt. I had to use the Numpy+MKL and the SciPy supplied in the WHL files to get it working.Cent
I take it that this solution only works with Python 2.7? Looks like there's no compiler for Python 3 as of Aug 2016Malang
@Malang this works very well with python3.6 for meAdmeasurement
This works like a charm. You may want to note that the cp27 in the filenames points to the version of python the .whl is for so download cp35 if you are running python 3.5, cp27 for 2.7 etc.Extraditable
Just wanted to highlight what @AlexanderMicklewright wrote. It wasn't obvious to me that the cpXX refers to the version X.X of (C)Python. I just implicitly chose the highest version cp36, although I'm running Python 3.5.Stupefaction
I was trying to follow a machine learning book which suggested I install the following packages: pip3 install --upgrade jupyter matplotlib numpy pandas scipy scikit-learn But this failed with the error stated by the OP. I ended up needing to use the scikit and numpy whl files from the lfd.uci.edu/~gohlke/pythonlibs link above. Without the numpy whl file from the link above, I ended up getting an import error.Stilwell
P
98

My python's version is 2.7.10, 64-bits Windows 7.

  1. Download scipy-0.18.0-cp27-cp27m-win_amd64.whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
  2. Open cmd
  3. Make sure scipy-0.18.0-cp27-cp27m-win_amd64.whl is in cmd's current directory, then type pip install scipy-0.18.0-cp27-cp27m-win_amd64.whl.

It will be successful installed.

Presley answered 19/9, 2016 at 16:29 Comment(7)
This should be marked as the answer; it worked and it's the most painless way to install it.Carangid
I am not sure what is the role of scikits.vectorplot-0.1.1-cp27-none-win_amd64.whl file here. I just downloaded scipy-0.18.0-cp27-cp27m-win_amd64.whl file from the given link which successfully installed scipy. Then I was prompted about missing numpy+mkl. I downloaded using the same link and installed using pip install. Works great and I agree this is the easiest solution I came across.Obliterate
Works with python 3.6 and windows 10 too.Arlana
Thanks! simple and easy solutionInterlingua
Your solution worked with Python 3.5 and Windows 10 too.Fluoridation
It is scipy‑0.19.1 now. May also need to install numpy+mkl in the same way, but not from pip install.Galliot
I am using Python2.7 and AMD64 but got this error scipy-1.0.0-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform. Any suggestions?Throughway
K
36

The solution to the absence of BLAS/LAPACK libraries for SciPy installations on Windows 7 64-bit is described here:

http://www.scipy.org/scipylib/building/windows.html

Installing Anaconda is much easier, but you still don't get Intel MKL or GPU support without paying for it (they are in the MKL Optimizations and Accelerate add-ons for Anaconda - I'm not sure if they use PLASMA and MAGMA either). With MKL optimization, numpy has outperformed IDL on large matrix computations by 10-fold. MATLAB uses the Intel MKL library internally and supports GPU computing, so one might as well use that for the price if they're a student ($50 for MATLAB + $10 for the Parallel Computing Toolbox). If you get the free trial of Intel Parallel Studio, it comes with the MKL library, as well as C++ and FORTRAN compilers that will come in handy if you want to install BLAS and LAPACK from MKL or ATLAS on Windows:

http://icl.cs.utk.edu/lapack-for-windows/lapack/

Parallel Studio also comes with the Intel MPI library, useful for cluster computing applications and their latest Xeon processsors. While the process of building BLAS and LAPACK with MKL optimization is not trivial, the benefits of doing so for Python and R are quite large, as described in this Intel webinar:

https://software.intel.com/en-us/articles/powered-by-mkl-accelerating-numpy-and-scipy-performance-with-intel-mkl-python

Anaconda and Enthought have built businesses out of making this functionality and a few other things easier to deploy. However, it is freely available to those willing to do a little work (and a little learning).

For those who use R, you can now get MKL optimized BLAS and LAPACK for free with R Open from Revolution Analytics.

EDIT: Anaconda Python now ships with MKL optimization, as well as support for a number of other Intel library optimizations through the Intel Python distribution. However, GPU support for Anaconda in the Accelerate library (formerly known as NumbaPro) is still over $10k USD! The best alternatives for that are probably PyCUDA and scikit-cuda, as copperhead (essentially a free version of Anaconda Accelerate) unfortunately ceased development five years ago. It can be found here if anybody wants to pick up where they left off.

Kraemer answered 25/4, 2015 at 2:56 Comment(6)
The only problem with icl.cs.utk.edu/lapack-for-windows/lapack is that it's confusing. Anyone have tips on what to do with it?Indecipherable
Short answer: use AnacondaInstallation
I use Anaconda and I still get the error. I had to download the whl file including mkl and install it to get it to work. (See Jaanus' answer below: vanilla numpy is not enough)Berdichev
2017 here - I got it working using the method here. It's not too bad once you understand but it's not as straightforward as it should be.Cameliacamella
The first link is broken. I think it should be scipy.github.io/devdocs/building/windows.html instead.Gearbox
Look here for conda numpy with openblas on windows.Scalping
A
29

2024 Update:

The links below no longer work due to lost funding (see https://github.com/python-ldap/python-ldap/issues/511).

Relevant wheel files can now be found at: https://github.com/cgohlke/numpy-mkl-wheels/releases. Check older releases for numpy+mkl and scipy files.


Sorry to necro, but this is the first google search result. This is the solution that worked for me:

  1. Download numpy+mkl wheel from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy. Use the version that is the same as your python version (check using python -V). Eg. if your python is 3.5.2, download the wheel which shows cp35

  2. Open command prompt and navigate to the folder where you downloaded the wheel. Run the command: pip install [file name of wheel]

  3. Download the SciPy wheel from: http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy (similar to the step above).

  4. As above, pip install [file name of wheel]

Aldon answered 24/10, 2016 at 0:39 Comment(4)
It's completely okay to post answers to dead questions. In fact, we actually review it every time a new user does this.Daughter
This worked for me for Python 3.5 32-bit on Windows 8 64-bit, as of 8 Jan 2017Twilley
thanks, worked for Python 3.6 with numpy 1.13.1 + mkl, pandas 0.20.3, scikit-learn 0.18.2, scipy 0.19.1Maffei
this worked for me on Windows 10 x64 using Python 3.6.2Farmstead
C
20

This was the order I got everything working. The second point is the most important one. Scipy needs Numpy+MKL, not just vanilla Numpy.

  1. Install python 3.5
  2. pip install "file path" (download Numpy+MKL wheel from here http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy)
  3. pip install scipy
Chabot answered 22/1, 2016 at 14:46 Comment(1)
Well, I did the steps 1) and 2), but in the third, I was getting the very same error. So after steps 1) and 2) I had to manually download the Scipy.whl Package from here: lfd.uci.edu/~gohlke/pythonlibs/#scipy and pip install "scipy downloaded path". Now it works great!Solanum
M
8

You probably just have too new (unsupported) Python 3.x installed.

This page has overcomplicated solutions to the problem. Most of numpy / scipy users should not need to compile their numpy installations or need to rely on 3rd party "numpy+mkl" wheels.

Downloading a compiler is an anti-pattern, you do not want to build numpy, only use it. [github.com/numpy]

Solution

  • Once you have installed supported python version, remove your non-working numpy installation with
pip uninstall numpy

and install scipy with

pip install scipy --only-binary numpy
  • The --only-binary numpy will force installing binary wheel (.whl) version of numpy. If it fails, you have too new (not yet supported) version of python.

  • If you have multiple python versions installed, you can ensure that pip is installing the python version you want by

<path_to_python_executable> -m pip install <X> 

instead of pip install <X>.

Why this is happening?

  • Scipy relies on numpy, as can be seen from the setup.py or just by reading the pip install logs.
  • If you have too new (non-supported) python installation, there are no built wheel (.whl) in the pip repository, but tarballs (.tar.gz), which in this case require the user machine to compile some C++-code during installation. See also: Python packaging: wheels vs tarball (tar.gz)

Appendix

  • Check the https://pypi.org/project/numpy/ for list of supported Python versions. Currently (2020-11-04) the newest supported python version is Python 3.9. when using numpy 1.19.3 or above, and Python 3.8 for numpy 1.19.2. (For compatibility of older numpy versions, see numpy release notes)
  • If you are on Windows and see pip trying to install numpy-<x>.tag.gz, you know it probably will not work. Try older version of Python, instead. You want to see pip to installing a binary wheel for numpy for Windows (numpy-<x>.whl). You can check the wheels in pip available for numpy here.
Madrid answered 26/10, 2020 at 13:7 Comment(0)
R
5

If you are working with Windows and Visual Studio 2015

Enter the following commands

  • "conda install numpy"
  • "conda install pandas"
  • "conda install scipy"
Rhymester answered 3/11, 2015 at 17:52 Comment(0)
F
3

Simple and Fast Installation of Scipy in Windows

  1. From http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy download the correct Scipy package for your Python version (e.g. the correct package for python 3.5 and Windows x64 is scipy-0.19.1-cp35-cp35m-win_amd64.whl).
  2. Open cmd inside the directory containing the downloaded Scipy package.
  3. Type pip install <<your-scipy-package-name>> (e.g. pip install scipy-0.19.1-cp35-cp35m-win_amd64.whl).
Fluoridation answered 21/7, 2017 at 19:32 Comment(2)
I got 'scipy-0.19.1-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.' when doing this.Eades
Worked for me: pip install https://download.lfd.uci.edu/pythonlibs/z2tqcw5k/scipy-1.5.3-cp39-cp39-win_amd64.whlEudoxia
S
2

My 5 cents; You can just install the entire (pre-compiled) SciPy from https://github.com/scipy/scipy/releases

Good Luck!

Surbeck answered 7/12, 2015 at 15:14 Comment(0)
P
1

For python27 1、Install numpy + mkl(download link:http://www.lfd.uci.edu/~gohlke/pythonlibs/) 2、install scipy (the same site) OK!

Phaeton answered 9/3, 2017 at 4:54 Comment(0)
G
1

Intel now provides a Python distribution for Linux / Windows / OS X for free called "Intel distribution for Python".

Its a complete Python distribution (e.g. python.exe is included in the package) which includes some pre-installed modules compiled against Intel's MKL (Math Kernel Library) and thus optimized for faster performance.

The distribution includes the modules NumPy, SciPy, scikit-learn, pandas, matplotlib, Numba, tbb, pyDAAL, Jupyter, and others. The drawback is a bit of lateness in upgrading to more recent versions of Python. For example as of today (1 May 2017) the distribution provides CPython 3.5 while the 3.6 version is already out. But if you don't need the new features they should be perfectly fine.

Grewitz answered 1/5, 2017 at 9:19 Comment(3)
Do you know if the BLAS libraries used are "dynamic"? I'm using theano, and if the libraries are "static", lots of problems appear.Lincolnlincolnshire
@Daniel what do you mean by static libraries? Python is an interpreted language. How are you using statically linked libraries? But I am not expert in this field. So possibly I am missing somethingGrewitz
O don't understand it quite well too. But that's a real issue for using theano. It needs that the BLAS libraries are dynamic (perhaps dynamically linked to numpy instead of statically linked to numpy?) -- Pyton does use a series of compiled libraries, that's why it can work so fast although interpreted.Lincolnlincolnshire
H
1

I was also getting same error while installing scikit-fuzzy. I resolved error as follows:

  1. Install Numpy, a whl file
  2. Install Scipy, again a whl file

choose file according to python version like amd64 for python3 and other win32 file for the python27

  1. then pip install --user skfuzzy

I hope, It will work for you

Honky answered 7/10, 2017 at 15:53 Comment(0)
W
1

Solutions:

  1. As specified in many answers, download NumPy and SciPy whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/ and install with

    pip install <whl_location>
    
  2. Building BLAS/LAPACK from source

  3. Using Miniconda.

Refer:

  1. ScikitLearn Installation
  2. Easiest way to install BLAS and LAPACK for scipy?
Warrantable answered 20/10, 2017 at 11:10 Comment(0)
D
1

do this, it solved for me pip install -U scikit-learn

Deuce answered 8/3, 2020 at 11:31 Comment(0)
W
1

I got the same error trying to install scipy, having also installed Visual Studio C++, numpy, etc. My problem was that I'd just installed Python 3.9.

I removed version 3.9.0 and downgraded to version 3.8.6 and scipy installed without problems.

Waw answered 18/11, 2020 at 17:36 Comment(0)
S
0

Using resources at http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy will solve the problem. However, you should be careful about versions compatibility. After trying for several times, finally I decided to uninstall python and then installed a fresh version of python along with numpy and then installed scipy and this resolved my problem.

Salmagundi answered 8/12, 2016 at 21:55 Comment(1)
Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline.Thoma
T
0

install intel's distribution of python https://software.intel.com/en-us/intel-distribution-for-python

better of for distribution of python should contain them initially

Turnabout answered 21/12, 2016 at 9:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.