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

ERROR: Failed building wheel for river #1517

Open
Mixto12 opened this issue Mar 18, 2024 · 11 comments
Open

ERROR: Failed building wheel for river #1517

Mixto12 opened this issue Mar 18, 2024 · 11 comments

Comments

@Mixto12
Copy link

Mixto12 commented Mar 18, 2024

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

This error occurs when I installing river via pip. Can anyone knows how to resolve this issue?

@AdilZouitine
Copy link
Member

AdilZouitine commented Mar 24, 2024

Hey, Could you provide a minimal reproducible example, please? With your system information?

@marinasie
Copy link

I am encountering the same problem with macOS 14.4.1. Steps to reproduce: pip install river

@MaxHalford
Copy link
Member

I'm sorry to hear that @marinasie. I'm on MacOS 14, Sonoma, and it's working. Could you share a traceback, including the error you obtained?

@marinasie
Copy link

Thanks for helping me out @MaxHalford ! This is my traceback when running pip install river:

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

  × Building wheel for river (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [116 lines of output]
      A setup.py file already exists. Using it.

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      # distutils: language = c++
      # distutils: extra_compile_args = "-std=c++11"

      import cython

      from .efficient_rollingrocauc cimport RollingROCAUC as CppRollingROCAUC
      ^
      ------------------------------------------------------------

      build/lib.linux-x86_64-cpython-312/river/metrics/efficient_rollingrocauc/efficient_rollingrocauc.pyx:6:0: relative cimport from non-package directory is not allowed

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      from .efficient_rollingrocauc cimport RollingROCAUC as CppRollingROCAUC

      cdef class EfficientRollingROCAUC:
          cdef cython.int positiveLabel
          cdef cython.ulong windowSize
          cdef CppRollingROCAUC* rollingrocauc
               ^
      ------------------------------------------------------------

      build/lib.linux-x86_64-cpython-312/river/metrics/efficient_rollingrocauc/efficient_rollingrocauc.pyx:11:9: 'CppRollingROCAUC' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
          cdef CppRollingROCAUC* rollingrocauc

          def __cinit__(self, cython.int positiveLabel, cython.ulong windowSize):
              self.positiveLabel = positiveLabel
              self.windowSize = windowSize
              self.rollingrocauc = new CppRollingROCAUC(positiveLabel, windowSize)
                                       ^
      ------------------------------------------------------------

      build/lib.linux-x86_64-cpython-312/river/metrics/efficient_rollingrocauc/efficient_rollingrocauc.pyx:16:33: 'CppRollingROCAUC' is not a type identifier

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
          cdef CppRollingROCAUC* rollingrocauc

          def __cinit__(self, cython.int positiveLabel, cython.ulong windowSize):
              self.positiveLabel = positiveLabel
              self.windowSize = windowSize
              self.rollingrocauc = new CppRollingROCAUC(positiveLabel, windowSize)
                                   ^
      ------------------------------------------------------------

      build/lib.linux-x86_64-cpython-312/river/metrics/efficient_rollingrocauc/efficient_rollingrocauc.pyx:16:29: new operator can only be applied to a C++ class

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              self.windowSize = windowSize
              self.rollingrocauc = new CppRollingROCAUC(positiveLabel, windowSize)

          def __dealloc__(self):
              if not self.rollingrocauc == NULL:
                  del self.rollingrocauc
                          ^
      ------------------------------------------------------------

      build/lib.linux-x86_64-cpython-312/river/metrics/efficient_rollingrocauc/efficient_rollingrocauc.pyx:20:20: Deletion of non-Python, non-C++ object
      Compiling build/lib.linux-x86_64-cpython-312/river/drift/adwin_c.pyx because it changed.
      Compiling build/lib.linux-x86_64-cpython-312/river/metrics/efficient_rollingrocauc/efficient_rollingrocauc.pyx because it depends on /private/var/folders/0b/nxx7zwbd6892znfk2t06h5n80000gn/T/pip-build-env-w84ohfek/overlay/lib/python3.10/site-packages/Cython/Includes/libcpp/vector.pxd.
      Compiling build/lib.linux-x86_64-cpython-312/river/metrics/expected_mutual_info.pyx because it changed.
      Compiling build/lib.linux-x86_64-cpython-312/river/utils/vectordict.pyx because it changed.
      Compiling river/drift/adwin_c.pyx because it changed.
      Compiling river/metrics/efficient_rollingrocauc/efficient_rollingrocauc.pyx because it depends on /private/var/folders/0b/nxx7zwbd6892znfk2t06h5n80000gn/T/pip-build-env-w84ohfek/overlay/lib/python3.10/site-packages/Cython/Includes/libcpp/vector.pxd.
      Compiling river/metrics/expected_mutual_info.pyx because it changed.
      Compiling river/utils/vectordict.pyx because it changed.
      [1/8] Cythonizing build/lib.linux-x86_64-cpython-312/river/drift/adwin_c.pyx
      [2/8] Cythonizing build/lib.linux-x86_64-cpython-312/river/metrics/expected_mutual_info.pyx
      [3/8] Cythonizing build/lib.linux-x86_64-cpython-312/river/utils/vectordict.pyx
      [4/8] Cythonizing river/drift/adwin_c.pyx
      [5/8] Cythonizing river/metrics/expected_mutual_info.pyx
      [6/8] Cythonizing river/utils/vectordict.pyx
      [7/8] Cythonizing build/lib.linux-x86_64-cpython-312/river/metrics/efficient_rollingrocauc/efficient_rollingrocauc.pyx
      Traceback (most recent call last):
        File "/private/var/folders/0b/nxx7zwbd6892znfk2t06h5n80000gn/T/pip-install-8jj_hf2x/river_5c1dc9f218384df098e06c22f57902ef/setup.py", line 82, in <module>
          from build import *
        File "/private/var/folders/0b/nxx7zwbd6892znfk2t06h5n80000gn/T/pip-install-8jj_hf2x/river_5c1dc9f218384df098e06c22f57902ef/build.py", line 22, in <module>
          ext_modules = cythonize(
        File "/private/var/folders/0b/nxx7zwbd6892znfk2t06h5n80000gn/T/pip-build-env-w84ohfek/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
          cythonize_one(*args)
        File "/private/var/folders/0b/nxx7zwbd6892znfk2t06h5n80000gn/T/pip-build-env-w84ohfek/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: build/lib.linux-x86_64-cpython-312/river/metrics/efficient_rollingrocauc/efficient_rollingrocauc.pyx
      Traceback (most recent call last):
        File "/Users/user/miniconda3/envs/bird/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/user/miniconda3/envs/bird/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/user/miniconda3/envs/bird/lib/python3.10/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 "/private/var/folders/0b/nxx7zwbd6892znfk2t06h5n80000gn/T/pip-build-env-w84ohfek/overlay/lib/python3.10/site-packages/poetry/core/masonry/api.py", line 58, in build_wheel
          return WheelBuilder.make_in(
        File "/private/var/folders/0b/nxx7zwbd6892znfk2t06h5n80000gn/T/pip-build-env-w84ohfek/overlay/lib/python3.10/site-packages/poetry/core/masonry/builders/wheel.py", line 88, in make_in
          wb.build(target_dir=directory)
        File "/private/var/folders/0b/nxx7zwbd6892znfk2t06h5n80000gn/T/pip-build-env-w84ohfek/overlay/lib/python3.10/site-packages/poetry/core/masonry/builders/wheel.py", line 121, in build
          self._build(zip_file)
        File "/private/var/folders/0b/nxx7zwbd6892znfk2t06h5n80000gn/T/pip-build-env-w84ohfek/overlay/lib/python3.10/site-packages/poetry/core/masonry/builders/wheel.py", line 182, in _build
          self._run_build_command(setup)
        File "/private/var/folders/0b/nxx7zwbd6892znfk2t06h5n80000gn/T/pip-build-env-w84ohfek/overlay/lib/python3.10/site-packages/poetry/core/masonry/builders/wheel.py", line 248, in _run_build_command
          subprocess.check_call([
        File "/Users/user/miniconda3/envs/bird/lib/python3.10/subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/Users/user/miniconda3/envs/bird/bin/python3', '/private/var/folders/0b/nxx7zwbd6892znfk2t06h5n80000gn/T/pip-install-8jj_hf2x/river_5c1dc9f218384df098e06c22f57902ef/setup.py', 'build', '-b', '/private/var/folders/0b/nxx7zwbd6892znfk2t06h5n80000gn/T/pip-install-8jj_hf2x/river_5c1dc9f218384df098e06c22f57902ef/build', '--build-purelib', '/private/var/folders/0b/nxx7zwbd6892znfk2t06h5n80000gn/T/pip-install-8jj_hf2x/river_5c1dc9f218384df098e06c22f57902ef/build/lib', '--build-platlib', '/private/var/folders/0b/nxx7zwbd6892znfk2t06h5n80000gn/T/pip-install-8jj_hf2x/river_5c1dc9f218384df098e06c22f57902ef/build/lib.macosx-10.9-x86_64-cpython-310']' 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 river
Failed to build river
ERROR: Could not build wheels for river, which is required to install pyproject.toml-based projects

@MaxHalford
Copy link
Member

May I ask which Python version you're using?

@marinasie
Copy link

Python 3.10.11 🐍

@MaxHalford
Copy link
Member

Ok super weird. Normally a pre-built wheel should be used, so you don't have to install from scratch. I asked because I see a cpython-312 in your traceback, making me think you're on Python 3.12... I'm not really sure how to help now 😅

@justinuliu
Copy link

I think there is no pre-built wheel for MacOS 14 on an Intel CPU, so Pip builds it from scratch.
I have no idea why Pip is using cpython3.12 instead of 3.9 in my case.

@hannahleblanc
Copy link

I am getting the same error as @marinasie with Python 3.11 mac 14.3 when using pip install river. I was also running into issues installing the latest development version from github until I ran rustup target add x86_64-apple-darwin, I don't seem to be getting errors now but I haven't tried out River yet.

@marinasie
Copy link

marinasie commented May 10, 2024

Yes, thank you @hannahleblanc !

This installation procedure solved it for me:

rustup target add x86_64-apple-darwin
pip install git+ssh://[email protected]/online-ml/river.git --upgrade  # using SSH
pip install git+https://github.com/online-ml/river --upgrade  # or alternatively run with https

Worked with python 3.10.11 and macOS 14.4.1

Now river works like a charm. 🚀

@adrian-valente
Copy link

Hi all, same error on macOS 12.5.1 (on x86 arch), python 3.10 or 3.12 equally, that disappears when rolling back to river 0.19.0 however. The command rustup target add x86_64-apple-darwin does not do the trick for me for installing river >=0.20.0

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

7 participants