Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling Temporian on Windows -- Building wheel for temporian (pyproject.toml) ... error #332

Open
kopes18 opened this issue Jan 9, 2024 · 11 comments

Comments

@kopes18
Copy link

kopes18 commented Jan 9, 2024

Building wheels for collected packages: temporian
  Building wheel for temporian (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for temporian (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [57 lines of output]
      fatal: not a git repository (or any of the parent directories): .git
      A setup.py file already exists. Using it.
      running build
      running bazel_build
      Traceback (most recent call last):
        File "C:\Users\xxzz\AppData\Local\Temp\pip-install-mfsrqwoh\temporian_7928305007e042308ed74670d834944b\setup.py", line 80, in <module>
          setup(**setup_kwargs)
        File "C:\Users\xxzz\AppData\Local\Temp\pip-build-env-odk8ya52\overlay\Lib\site-packages\setuptools\__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\xxzz\AppData\Local\Temp\pip-build-env-odk8ya52\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "C:\Users\xxzz\AppData\Local\Temp\pip-build-env-odk8ya52\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
          dist.run_commands()
        File "C:\Users\xxzz\AppData\Local\Temp\pip-build-env-odk8ya52\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "C:\Users\xxzz\AppData\Local\Temp\pip-build-env-odk8ya52\overlay\Lib\site-packages\setuptools\dist.py", line 963, in run_command
          super().run_command(command)
        File "C:\Users\xxzz\AppData\Local\Temp\pip-build-env-odk8ya52\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\xxzz\AppData\Local\Temp\pip-build-env-odk8ya52\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run
          self.run_command(cmd_name)
        File "C:\Users\xxzz\AppData\Local\Temp\pip-build-env-odk8ya52\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "C:\Users\xxzz\AppData\Local\Temp\pip-build-env-odk8ya52\overlay\Lib\site-packages\setuptools\dist.py", line 963, in run_command
          super().run_command(command)
        File "C:\Users\xxzz\AppData\Local\Temp\pip-build-env-odk8ya52\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
          cmd_obj.ensure_finalized()
        File "C:\Users\xxzz\AppData\Local\Temp\pip-build-env-odk8ya52\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 111, in ensure_finalized
          self.finalize_options()
        File "C:\Users\xxzz\AppData\Local\Temp\pip-install-mfsrqwoh\temporian_7928305007e042308ed74670d834944b\config\build.py", line 57, in finalize_options
          raise RuntimeError(
      RuntimeError: Could not find "bazel" binary. Please visit https://docs.bazel.build/versions/master/install.html for installation instruction.
      Traceback (most recent call last):
        File "C:\Users\xxzz\anaconda3\envs\quant\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\xxzz\anaconda3\envs\quant\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\xxzz\anaconda3\envs\quant\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\xxzz\AppData\Local\Temp\pip-build-env-odk8ya52\overlay\Lib\site-packages\poetry\core\masonry\api.py", line 58, in build_wheel
          return WheelBuilder.make_in(
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\xxzz\AppData\Local\Temp\pip-build-env-odk8ya52\overlay\Lib\site-packages\poetry\core\masonry\builders\wheel.py", line 88, in make_in
          wb.build(target_dir=directory)
        File "C:\Users\xxzz\AppData\Local\Temp\pip-build-env-odk8ya52\overlay\Lib\site-packages\poetry\core\masonry\builders\wheel.py", line 121, in build
          self._build(zip_file)
        File "C:\Users\xxzz\AppData\Local\Temp\pip-build-env-odk8ya52\overlay\Lib\site-packages\poetry\core\masonry\builders\wheel.py", line 182, in _build
          self._run_build_command(setup)
        File "C:\Users\xxzz\AppData\Local\Temp\pip-build-env-odk8ya52\overlay\Lib\site-packages\poetry\core\masonry\builders\wheel.py", line 250, in _run_build_command
          subprocess.check_call(
        File "C:\Users\xxzz\anaconda3\envs\quant\Lib\subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['C:/Users/xxzz/anaconda3/envs/quant/python.exe', 'C:\\Users\\xxzz\\AppData\\Local\\Temp\\pip-install-mfsrqwoh\\temporian_7928305007e042308ed74670d834944b\\setup.py', 'build', '-b', 'C:\\Users\\xxzz\\AppData\\Local\\Temp\\pip-install-mfsrqwoh\\temporian_7928305007e042308ed74670d834944b\\build', '--build-purelib', 'C:\\Users\\xxzz\\AppData\\Local\\Temp\\pip-install-mfsrqwoh\\temporian_7928305007e042308ed74670d834944b\\build\\lib', '--build-platlib', 'C:\\Users\\xxzz\\AppData\\Local\\Temp\\pip-install-mfsrqwoh\\temporian_7928305007e042308ed74670d834944b\\build\\lib.win-amd64-cpython-311']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for temporian
Failed to build temporian
ERROR: Could not build wheels for temporian, which is required to install pyproject.toml-based projects

Do I need to install Bazel on windows 11? (put bazel.exe in PATH. same error)
python 3.11

@tkaraouzene
Copy link

tkaraouzene commented Jan 9, 2024

Hello !

Same error for me using poetry:

poetry add temporian

  Backend subprocess exited when trying to invoke build_wheel

  fatal: not a git repository (or any of the parent directories): .git
  A setup.py file already exists. Using it.
  running build
  running bazel_build
  Traceback (most recent call last):
    File "C:\Users\SESAXXX\AppData\Local\Temp\tmp49qiaaoo\temporian-0.1.6\setup.py", line 80, in <module>
      setup(**setup_kwargs)
    File "C:\Users\SESA49~1\AppData\Local\Temp\tmp2n1x8krq\.venv\lib\site-packages\setuptools\__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
    File "C:\Users\SESA49~1\AppData\Local\Temp\tmp2n1x8krq\.venv\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
      return run_commands(dist)
    File "C:\Users\SESA49~1\AppData\Local\Temp\tmp2n1x8krq\.venv\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
      dist.run_commands()
    File "C:\Users\SESA49~1\AppData\Local\Temp\tmp2n1x8krq\.venv\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "C:\Users\SESA49~1\AppData\Local\Temp\tmp2n1x8krq\.venv\lib\site-packages\setuptools\dist.py", line 963, in run_command
      super().run_command(command)
    File "C:\Users\SESA49~1\AppData\Local\Temp\tmp2n1x8krq\.venv\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "C:\Users\SESA49~1\AppData\Local\Temp\tmp2n1x8krq\.venv\lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run
      self.run_command(cmd_name)
    File "C:\Users\SESA49~1\AppData\Local\Temp\tmp2n1x8krq\.venv\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "C:\Users\SESA49~1\AppData\Local\Temp\tmp2n1x8krq\.venv\lib\site-packages\setuptools\dist.py", line 963, in run_command
      super().run_command(command)
    File "C:\Users\SESA49~1\AppData\Local\Temp\tmp2n1x8krq\.venv\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
      cmd_obj.ensure_finalized()
    File "C:\Users\SESA49~1\AppData\Local\Temp\tmp2n1x8krq\.venv\lib\site-packages\setuptools\_distutils\cmd.py", line 111, in ensure_finalized
      self.finalize_options()
    File "C:\Users\XXX\AppData\Local\Temp\tmp49qiaaoo\temporian-0.1.6\config\build.py", line 57, in finalize_options
      raise RuntimeError(
  RuntimeError: Could not find "bazel" binary. Please visit https://docs.bazel.build/versions/master/install.html for installation instruction.
  Traceback (most recent call last):
    File "C:\Users\XXX\AppData\Local\Programs\Python\Python39\lib\site-packages\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "C:\Users\XXX\AppData\Local\Programs\Python\Python39\lib\site-packages\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\Users\XXX\AppData\Local\Programs\Python\Python39\lib\site-packages\pyproject_hooks\_in_process\_in_process.py", line 251, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
    File "C:\Users\XXX1\AppData\Local\Temp\tmp2n1x8krq\.venv\lib\site-packages\poetry\core\masonry\api.py", line 58, in build_wheel
      return WheelBuilder.make_in(
    File "C:\Users\XXX\AppData\Local\Temp\tmp2n1x8krq\.venv\lib\site-packages\poetry\core\masonry\builders\wheel.py", line 88, in make_in
      wb.build(target_dir=directory)
    File "C:\Users\XXX\AppData\Local\Temp\tmp2n1x8krq\.venv\lib\site-packages\poetry\core\masonry\builders\wheel.py", line 121, in build
      self._build(zip_file)
    File "C:\Users\XXX\AppData\Local\Temp\tmp2n1x8krq\.venv\lib\site-packages\poetry\core\masonry\builders\wheel.py", line 182, in _build
      self._run_build_command(setup)
    File "C:\Users\SESA49~1\AppData\Local\Temp\tmp2n1x8krq\.venv\lib\site-packages\poetry\core\masonry\builders\wheel.py", line 250, in _run_build_command
      subprocess.check_call(
    File "C:\Users\XXX\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 373, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['C:/Users/SESA49~1/AppData/Local/Temp/tmp2n1x8krq/.venv/Scripts/python.exe', 'C:\\Users\\XXX\\AppData\\Local\\Temp\\tmp49qiaaoo\\
temporian-0.1.6\\setup.py', 'build', '-b', 'C:\\Users\\XXX\\AppData\\Local\\Temp\\tmp49qiaaoo\\temporian-0.1.6\\build', '--build-purelib', 'C:\\Users\\XXX\\AppData\\
Local\\Temp\\tmp49qiaaoo\\temporian-0.1.6\\build\\lib', '--build-platlib', 'C:\\Users\\XXX\\AppData\\Local\\Temp\\tmp49qiaaoo\\temporian-0.1.6\\build\\lib.win-amd64-cpython
-39']' returned non-zero exit status 1.


  at ~\AppData\Local\Programs\Python\Python39\lib\site-packages\poetry\installation\chef.py:147 in _prepare
      143│ 
      144│                 error = ChefBuildError("\n\n".join(message_parts))
      145│
      146│             if error is not None:
    → 147│                 raise error from None
      148│
      149│             return path
      150│
      151│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with temporian (0.1.6) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "temporian (==0.1.6)"'.

System information

OS: Microsoft Windows 10 Professional
version: 10.0.19045 Build 19045
python: 3.9.13 (same with 3.11.z)

@trigaut
Copy link

trigaut commented Jan 9, 2024

Hello, same issue on Windows 11, python 3.11.

I installed Bazelisk through winget and then Bazel using Bazelisk, and added bazel.exe to my Path.

Now bazel binary is found but when pip installing temporian, during the wheel building process, the bazel command still fails with exit code 2.

subprocess.CalledProcessError: Command '['C:\\I_HIDE_MY_FULL_PATH\\bazel.exe', 'run', '-c', 'opt', '--copt=-DWIN32_LEAN_AND_MEAN', '@temporian//config:move_generated_files']' returned non-zero exit status 2.   

according to bazel doc it means:

2 - Command Line Problem, Bad or Illegal flags or command combination, or Bad Environment Variables. Your command line must be modified.

EDIT: I guess it's because https://github.com/google/temporian/blob/main/config/move_generated_files.sh is a sh script

@ianspektor
Copy link
Collaborator

Hey!

Temporian is not yet supported on Windows - we're working on it. Will keep you all updated if there's any news! Sorry for the missing disclaimer, will add one to the README asap.

@trigaut
Copy link

trigaut commented Jan 9, 2024

Would be glad to contribute if you need and if you know what remains to be done to support windows

@rstz
Copy link
Collaborator

rstz commented Jan 9, 2024

One first step would be to adapt the config/move_generated_files.sh script to work with windows. This script is adapted from other google projects - you can try just making it similar to what tensorflow-gnn is doing here https://github.com/tensorflow/gnn/blob/v1.0.0/package/move_generated_files.sh (I don't have a Windows machine on hand to try myself right now)

@trigaut
Copy link

trigaut commented Jan 11, 2024

I tested PR #334 on main by pip install git+https://github.com/google/temporian.git@main

I still get an error at the same point but with a status 48 that is not referenced in Bazel doc

bazel.exe', 'run', '-c', 'opt', '--copt=-DWIN32_LEAN_AND_MEAN', '--config=windows', '@temporian//config:move_generated_files']' returned non-zero exit status 48

We could maybe reopen the issue?

@achoum
Copy link
Collaborator

achoum commented Jan 17, 2024

Hi all,

The precompiled Windows amd64 packages are now available on PyPi :) i.e. you can do pip install temporian on Windows :).

If you want to compile Temporian from source on Windows, you can use the tools/build.bat script. To run this script, you will need Bazel 5 (e.g. 5.4.1), Microsoft Visual Studio 2019, and MSYS2.

The Windows build is not yet well integrated into poetry (e.g. poetry build does not work on Windows) and GitHub (publish.yaml action). @trigaut, since you proposed, and if this is something you know how to do, this would be a fantastic contribution :).

@achoum
Copy link
Collaborator

achoum commented Jan 17, 2024

Re-opening the issue. We can close it when poetry build works on Windows.

@achoum achoum reopened this Jan 17, 2024
@achoum achoum changed the title Building wheel for temporian (pyproject.toml) ... error Compiling Temporian on Windows -- Building wheel for temporian (pyproject.toml) ... error Jan 17, 2024
@trigaut
Copy link

trigaut commented Jan 18, 2024

Pip install works like a charm indeed ! Thanks @achoum .

The Windows build is not yet well integrated into poetry (e.g. poetry build does not work on Windows) and GitHub (publish.yaml action). @trigaut, since you proposed, and if this is something you know how to do, this would be a fantastic contribution :).

I will have a look at the poetry build but did not use poetry that much. Maybe my colleague @tkaraouzene , who is more experienced with poetry, will be able to help as well 😉 .

@tkaraouzene
Copy link

Hi @achoum!
Thanks for this reactivity.
I'll try to have a look on it during coming days.
I'll let you know if it works on my side

@tkaraouzene
Copy link

Hello !
I can confirm that the installation works on my side.
I have not the time right now to do deeper tests.
I will probably test your library during coming weeks.
I'll let you know if I have other issues.
Thanks again for your reactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants