2

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?

Daniel Möller
  • 84,878
  • 18
  • 192
  • 214

2 Answers2

2

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.

cgohlke
  • 9,142
  • 2
  • 33
  • 36
  • Hmmm, thanks a lot :) -- But then.... is there a reason for my BLAS test from theano get such a terrible result? -- I get the test done in 20seconds, but from the table they present, it should take around 3 seconds. – Daniel Möller Aug 23 '17 at 16:55
  • Do you happen to know anything about this? https://stackoverflow.com/questions/45722188/tutorial-for-installing-numpy-with-openblas-on-windows – Daniel Möller Aug 23 '17 at 16:58
0

I have tried something like this:

pip install --install-option="--prefix=$PREFIX_PATH" package_name

I the above line:

$PREFIX_PATH ---- Change the path you want to specify.
package_name ---- Change the Package name with the desired package name or the wheel file.  

On Windows, I tried the above and it is not working. But the below answer will work:

python.exe -m pip install --target=c:\data\ pandas

The pandas got stored in the data folder. Only the thing we need to do is we have to specify the path to our Python, so that it will fetch the proper library. You can go in the data folder and run python. You will be able to access the library.
Hope this helps you.

Jaffer Wilson
  • 7,029
  • 10
  • 62
  • 139
  • Target directory remained completely empty. The installation was done in the default folder (which is already the user folder). Numpy config still points to `C:\program files (x86)\IntelSWTools`. -- This question is not about just installing a package somewhere, it's about the package itself trying to place some files elsewhere. – Daniel Möller Aug 23 '17 at 12:38
  • @Daniel Hope this helps you. I have edited the answer. – Jaffer Wilson Aug 23 '17 at 13:34