13

I am trying to install jaxlib on my windows 10 by the following command which I found on the documentation..

pip install jaxlib

It shows the following error

Collecting jaxlib
  Could not find a version that satisfies the requirement jaxlib (from versions: None)
No matching distribution found for jaxlib
keepAlive
  • 6,369
  • 5
  • 24
  • 39
  • [from PyPL](https://pypi.org/project/jaxlib/#files) can download some wheels, then `pip install – JeeyCi Aug 06 '23 at 16:11

5 Answers5

12

Thanks to cloudhan's jax-windows-builder, it is now rather easy to install JAX and jaxlib on windows. E.g.

pip install jax==0.3.13 https://whls.blob.core.windows.net/unstable/cuda111/jaxlib-0.3.7+cuda11.cudnn82-cp38-none-win_amd64.whl

That's all.


As explained there, I had to copy the jaxlib's link address of the whl file I was interested in, i.e. the https://whls.blob.core... above).

But I also had to take care that JAX's version and Jaxlib's were compatible, which compatibility is easy to assess at github.com/google/jax/releases: just pick the last two of each (!)the version numbers! nothing to download from there.


tested with the versions explicited above. I.e. python3.8-64 & jax==0.3.13 & jaxlib-0.3.7

keepAlive
  • 6,369
  • 5
  • 24
  • 39
  • cloudhan is having wheels only for windows 64x, do you know if there are wheels for win-32x somewhere? (can't find) – JeeyCi Aug 06 '23 at 15:38
11

Jaxlib is not supported on windows you can see it here.. https://github.com/google/jax/issues/438

7

I went through the process the last two days myself so here is what i did:

  1. download and install the latest version of microsoft visual studio ( to get a c++ compiler and toolchain)

  2. download and install python

  3. create a virtual python environment with the packages pip, setuptools, six, wheel and numpy (i did it in the GUI of pycharm)

  4. download jax

  1. open up a windows powershell as administrator, change to the jax directory and complete the following steps (commands are in quotes)
  • install chocolatey (package manager for easy bazel installation)

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

  • install bazel (for building jaxlib)

choco install bazel

  • install msys2 (linux utilities for bazel)

choco install msys2

  • permamently link the python environment in your powershell

[System.Environment]::SetEnvironmentVariable("PATH", $Env:Path + ";C:\path\to\venv", "Machine")

  • still beeing in the jax folder in powershell actually build and compile jax

./build/build.py

  • after installation execute the command you're ask to to install jaxlib, it's something like

pip install c:\...\jax\dist\jaxlib-0.1.72-cp39-none-win_amd64.whl

  • and finally install jax with it

pip install -e .

This way it worked for me, since the documentation on the jax homepage utterly confused me.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Alecjasper
  • 71
  • 1
  • 2
  • Running `./build/build.py` just opens the file, so I activated my virtual environment and ran `py ./build/build.py` instead. When I do that I get the follow error: `ERROR: Analysis of target '//build:build_wheel' failed; build aborted: Configuration Error: --define PYTHON_BIN_PATH='C:/users/username/documents/virtual-environment-folder/Scripts/python.exe' is not executable. Is it the python binary?`. This path is valid, do you have any suggestions on how to get around this? – John Moody Jun 16 '22 at 16:10
  • I got around this issue by typing py ./build/build.py, but I wasn't in a virtual environment at the time. – kelkka Aug 17 '22 at 14:43
-1

JAX does not provide jaxlib builds for Windows at this moment of time.

Issue 1, issue 2

But you can build it yourself if you wish.There are some comments in the above issue that might help you.

-4

This worked for me:

powershell -ExecutionPolicy ByPass -NoExit -Command "& 'C:\users\<username>\Anaconda3\condabin\conda_hook.bat' ; conda activate <yourcondaEnvironment>"
Shaido
  • 27,497
  • 23
  • 70
  • 73
J R
  • 1