0

I am trying to install JAX in Windows, using the steps detailed in this answer.

But I am getting an error when trying to build JAX.

Here is what I have tried to do:

  1. I have downloaded JAX

  2. Installed Bazel and msys2 using choco. Restarted computer.

  3. Linked virtual environment to path

    [System.Environment]::SetEnvironmentVariable("PATH", $Env:Path + ";C:\users\myuser\documents\virtualenv\", "Machine")

  4. Openen powershell as admin

  5. Activated virtualenv

  6. Tried to build JAX:

    (virtualenv) PS C:\users\myuser\documents\virtualenv\jax-main> py ./build/build.py

  7. Gett he following error

     _   _  __  __
    | | / \ \ \/ /
 _  | |/ _ \ \  /
| |_| / ___ \/  \
 \___/_/   \/_/\_\


Bazel binary path: .\bazel-5.1.1-windows-x86_64.exe
Bazel version: 5.1.1
Python binary path: C:/users/myuser/documents/virtualenv/Scripts/python.exe
Python version: 3.10
NumPy version: 1.22.3
MKL-DNN enabled: yes
Target CPU: AMD64
Target CPU features: release
CUDA enabled: no
TPU enabled: no
ROCm enabled: no

Building XLA and installing it in the jaxlib source tree...
.\bazel-5.1.1-windows-x86_64.exe run --verbose_failures=true --config=mkl_open_source_only :build_wheel -- --output_path=C:\users\myuser\documents\virtualenv\jax-main\dist --cpu=AMD64
WARNING: Option 'experimental_strict_action_env' is deprecated: Use --incompatible_strict_action_env instead
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=80
INFO: Reading rc options for 'run' from c:\users\myuser\documents\virtualenv\jax-main\.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Options provided by the client:
  Inherited 'build' options: --python_path=C:/users/myuser/documents/virtualenv/scripts/python.exe
INFO: Reading rc options for 'run' from c:\users\myuser\documents\virtualenv\jax-main\.bazelrc:
  Inherited 'build' options: --apple_platform_type=macos --macos_minimum_os=10.14 --announce_rc --define open_source_build=true --spawn_strategy=standalone --enable_platform_specific_config --experimental_cc_shared_library --define=no_aws_support=true --define=no_gcp_support=true --define=no_hdfs_support=true --define=no_kafka_support=true --define=no_ignite_support=true --define=grpc_no_ares=true -c opt --config=short_logs --copt=-DMLIR_PYTHON_PACKAGE_PREFIX=jaxlib.mlir. --@org_tensorflow//tensorflow/compiler/xla/python:enable_gpu=false --@org_tensorflow//tensorflow/compiler/xla/python:enable_tpu=false
INFO: Reading rc options for 'run' from c:\users\myuser\documents\virtualenv\jax-main\.jax_configure.bazelrc:
  Inherited 'build' options: --strategy=Genrule=standalone --repo_env PYTHON_BIN_PATH=C:/users/myuser/documents/virtualenv/Scripts/python.exe --action_env=PYENV_ROOT --python_path=C:/users/myuser/documents/virtualenv/Scripts/python.exe --distinct_host_configuration=false
INFO: Found applicable config definition build:short_logs in file c:\users\myuser\documents\virtualenv\jax-main\.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:mkl_open_source_only in file c:\users\myuser\documents\virtualenv\jax-main\.bazelrc: --define=tensorflow_mkldnn_contraction_kernel=1
INFO: Found applicable config definition build:windows in file c:\users\myuser\documents\virtualenv\jax-main\.bazelrc: --copt=/D_USE_MATH_DEFINES --host_copt=/D_USE_MATH_DEFINES --copt=-DWIN32_LEAN_AND_MEAN --host_copt=-DWIN32_LEAN_AND_MEAN --copt=-DNOGDI --host_copt=-DNOGDI --copt=/Zc:preprocessor --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 --linkopt=/DEBUG --host_linkopt=/DEBUG --linkopt=/OPT:REF --host_linkopt=/OPT:REF --linkopt=/OPT:ICF --host_linkopt=/OPT:ICF --experimental_strict_action_env=true
INFO: Repository local_config_python instantiated at:
  C:/users/myuser/documents/virtualenv/jax-main/WORKSPACE:38:14: in <toplevel>
  C:/users/myuser/_bazel_myuser/rdaimxe6/external/org_tensorflow/tensorflow/workspace2.bzl:870:19: in workspace
  C:/users/myuser/_bazel_myuser/rdaimxe6/external/org_tensorflow/tensorflow/workspace2.bzl:100:21: in _tf_toolchains
Repository rule python_configure defined at:
  C:/users/myuser/_bazel_myuser/rdaimxe6/external/org_tensorflow/third_party/py/python_configure.bzl:298:35: in <toplevel>
INFO: Repository local_execution_config_python instantiated at:
  C:/users/myuser/documents/virtualenv/jax-main/WORKSPACE:38:14: in <toplevel>
  C:/users/myuser/_bazel_myuser/rdaimxe6/external/org_tensorflow/tensorflow/workspace2.bzl:870:19: in workspace
  C:/users/myuser/_bazel_myuser/rdaimxe6/external/org_tensorflow/tensorflow/workspace2.bzl:90:27: in _tf_toolchains
  C:/users/myuser/_bazel_myuser/rdaimxe6/external/org_tensorflow/tensorflow/tools/toolchains/remote_config/configs.bzl:6:28: in initialize_rbe_configs
  C:/users/myuser/_bazel_myuser/rdaimxe6/external/org_tensorflow/tensorflow/tools/toolchains/remote_config/rbe_config.bzl:158:27: in _tensorflow_local_config
Repository rule local_python_configure defined at:
  C:/users/myuser/_bazel_myuser/rdaimxe6/external/org_tensorflow/third_party/py/python_configure.bzl:279:41: in <toplevel>
ERROR: An error occurred during the fetch of repository 'local_config_python':
   Traceback (most recent call last):
        File "C:/users/myuser/_bazel_myuser/rdaimxe6/external/org_tensorflow/third_party/py/python_configure.bzl", line 271, column 40, in _python_autoconf_impl
                _create_local_python_repository(repository_ctx)
        File "C:/users/myuser/_bazel_myuser/rdaimxe6/external/org_tensorflow/third_party/py/python_configure.bzl", line 212, column 22, in _create_local_python_repository
                _check_python_bin(repository_ctx, python_bin)
        File "C:/users/myuser/_bazel_myuser/rdaimxe6/external/org_tensorflow/third_party/py/python_configure.bzl", line 145, column 25, in _check_python_bin
                auto_config_fail("--define %s='%s' is not executable. Is it the python binary?" % (
        File "C:/users/myuser/_bazel_myuser/rdaimxe6/external/org_tensorflow/third_party/remote_config/common.bzl", line 12, column 9, in auto_config_fail
                fail("%sConfiguration Error:%s %s\n" % (red, no_color, msg))
Error in fail: Configuration Error: --define PYTHON_BIN_PATH='C:/users/myuser/documents/virtualenv/Scripts/python.exe' is not executable. Is it the python binary?
ERROR: C:/users/myuser/documents/virtualenv/jax-main/WORKSPACE:38:14: fetching python_configure rule //external:local_config_python: Traceback (most recent call last):
        File "C:/users/myuser/_bazel_myuser/rdaimxe6/external/org_tensorflow/third_party/py/python_configure.bzl", line 271, column 40, in _python_autoconf_impl
                _create_local_python_repository(repository_ctx)
        File "C:/users/myuser/_bazel_myuser/rdaimxe6/external/org_tensorflow/third_party/py/python_configure.bzl", line 212, column 22, in _create_local_python_repository
                _check_python_bin(repository_ctx, python_bin)
        File "C:/users/myuser/_bazel_myuser/rdaimxe6/external/org_tensorflow/third_party/py/python_configure.bzl", line 145, column 25, in _check_python_bin
                auto_config_fail("--define %s='%s' is not executable. Is it the python binary?" % (
        File "C:/users/myuser/_bazel_myuser/rdaimxe6/external/org_tensorflow/third_party/remote_config/common.bzl", line 12, column 9, in auto_config_fail
                fail("%sConfiguration Error:%s %s\n" % (red, no_color, msg))
Error in fail: Configuration Error: --define PYTHON_BIN_PATH='C:/users/myuser/documents/virtualenv/Scripts/python.exe' is not executable. Is it the python binary?
INFO: Repository go_sdk instantiated at:
  C:/users/myuser/documents/virtualenv/jax-main/WORKSPACE:44:14: in <toplevel>
  C:/users/myuser/_bazel_myuser/rdaimxe6/external/org_tensorflow/tensorflow/workspace0.bzl:134:20: in workspace
  C:/users/myuser/_bazel_myuser/rdaimxe6/external/com_github_grpc_grpc/bazel/grpc_extra_deps.bzl:36:27: in grpc_extra_deps
  C:/users/myuser/_bazel_myuser/rdaimxe6/external/io_bazel_rules_go/go/toolchain/toolchains.bzl:379:28: in go_register_toolchains
  C:/users/myuser/_bazel_myuser/rdaimxe6/external/io_bazel_rules_go/go/private/sdk.bzl:65:21: in go_download_sdk
Repository rule _go_download_sdk defined at:
  C:/users/myuser/_bazel_myuser/rdaimxe6/external/io_bazel_rules_go/go/private/sdk.bzl:53:35: in <toplevel>
ERROR: Analysis of target '//build:build_wheel' failed; build aborted: Configuration Error: --define PYTHON_BIN_PATH='C:/users/myuser/documents/virtualenv/Scripts/python.exe' is not executable. Is it the python binary?
INFO: Elapsed time: 0.481s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets conf\
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets conf\
igured)
    Fetching https://dl.google.com/go/go1.12.5.windows-amd64.zip
b''
Traceback (most recent call last):
  File "C:\users\myuser\documents\virtualenv\jax-main\build\build.py", line 528, in <module>
    main()
  File "C:\users\myuser\documents\virtualenv\jax-main\build\build.py", line 523, in main
    shell(command)
  File "C:\users\myuser\documents\virtualenv\jax-main\build\build.py", line 53, in shell
    output = subprocess.check_output(cmd)
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['.\\bazel-5.1.1-windows-x86_64.exe', 'run', '--verbose_failures=true', '--config=mkl_open_source_only', ':build_wheel', '--', '--output_path=C:\\users\\myuser\\documents\\virtualenv\\jax-main\\dist', '--cpu=AMD64']' returned non-zero exit status 1.

Any ideas on how to get around that?

The error asks if PYTHON_BIN_PATH is pointing to the python binary and it is. This is the same path I get when running sys.executable from inside the virtualenvironment.

PYTHON_BIN_PATH='C:/users/myuser/documents/virtualenv/Scripts/python.exe' is not executable. Is it the python binary?

John Moody
  • 81
  • 10

0 Answers0