Search code examples
pythonnumpypipintel-mklpython-wheel

Gohlke's numpy + mkl installation - Change MKL install directory on Windows


I've been trying to get a working fast numpy with BLAS on Windows, and so far, the only method that seems feasible is downloading the precompiled library with MKL from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy.

So far ok, but chekcing later numpy.__config__.show(), I see it points to directories that don't exist, such as C:\program files (x86)\IntelSWTools

I assume numpy is trying to place the MKL libraries in this directory, but I have no administration privileges for creating files in C:\program files (x86).

Is there any simple way to use this numpy distribution and install the MKL libs in another directory? Such as a pip install filename.whl --some_option_to_install_mkl_in_another_dir?

(Windows 7 64bit, python 3.5.2)


Already attempted:

  • Use pip install <package> --user: it seems to install everything exactly the same way as the same command without --user. (My default installation folder is aldready the user folder)

  • User pip install <package> --root <some_path>: installs everything in the passed path, but Numpy config still points to C:\program files (x86)\IntelSWTools, and python cannot find numpy, even if I add <some_path> to both PATH and PYTHONPATH environment vars

  • Tried to create the pip.ini file, with the lines [global] and target=E:\destination. The destination folder remains untouched.

  • Rename the wheels file to zip, find all files containing the IntelSWTools folder, change all these folders to one that I have access to. Make it a wheels file again and pip install. Absolutely no file appears in the folder I chose, but numpy config is pointing to that folder. -- This makes me wonder: does this distribution really installs MKL?


Solution

  • Numpy+MKL does not place (or try to place) MKL libraries in C:\program files (x86)\IntelSWTools. The MKL runtime DLLs necessary to use numpy+MKL are copied to sys.prefix\Lib\site-packages\numpy\core during installation with pip.

    C:\program files (x86)\IntelSWTools is the location of the MKL development files (link libraries, header files, DLLs, documentation) that were used to build numpy+MKL. If you want to build other software from source that relies on MKL development files, you need to download MKL from Intel.