crflynn / skranger

scikit-learn compatible Python bindings for ranger C++ random forest library
https://skranger.readthedocs.io/en/stable/
GNU General Public License v3.0
51 stars 7 forks source link

Error: pip won't install skranger #137

Closed robinfallegger closed 2 years ago

robinfallegger commented 2 years ago

I've been trying to install skranger with pip and python 3.10 and get the following error:

pip install skranger
Collecting skranger
  Using cached skranger-0.7.0.tar.gz (117 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting scikit-learn<1,>=0.23.0
  Using cached scikit_learn-0.24.2-cp310-cp310-macosx_12_0_arm64.whl
Collecting joblib>=0.11
  Using cached joblib-1.1.0-py2.py3-none-any.whl (306 kB)
Collecting numpy>=1.13.3
  Using cached numpy-1.22.2-cp310-cp310-macosx_11_0_arm64.whl (12.8 MB)
Collecting threadpoolctl>=2.0.0
  Using cached threadpoolctl-3.1.0-py3-none-any.whl (14 kB)
Collecting scipy>=0.19.1
  Using cached scipy-1.8.0-cp310-cp310-macosx_12_0_arm64.whl (28.7 MB)
Building wheels for collected packages: skranger
  Building wheel for skranger (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for skranger (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      A setup.py file already exists. Using it.
      Traceback (most recent call last):
        File "/private/var/folders/vl/1y1qg3c911x2hvqbsl7zfpz40000gn/T/pip-install-j11qco2c/skranger_6ff5d9db353b42c3b49c2a63103f1383/setup.py", line 2, in <module>
          from setuptools import setup
      ModuleNotFoundError: No module named 'setuptools'
      Traceback (most recent call last):
        File "/opt/homebrew/Caskroom/miniforge/base/envs/env3/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/opt/homebrew/Caskroom/miniforge/base/envs/env3/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/opt/homebrew/Caskroom/miniforge/base/envs/env3/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/private/var/folders/vl/1y1qg3c911x2hvqbsl7zfpz40000gn/T/pip-build-env-65h215aj/overlay/lib/python3.10/site-packages/poetry/core/masonry/api.py", line 68, in build_wheel
          return unicode(WheelBuilder.make_in(poetry, Path(wheel_directory)))
        File "/private/var/folders/vl/1y1qg3c911x2hvqbsl7zfpz40000gn/T/pip-build-env-65h215aj/overlay/lib/python3.10/site-packages/poetry/core/masonry/builders/wheel.py", line 72, in make_in
          wb.build()
        File "/private/var/folders/vl/1y1qg3c911x2hvqbsl7zfpz40000gn/T/pip-build-env-65h215aj/overlay/lib/python3.10/site-packages/poetry/core/masonry/builders/wheel.py", line 103, in build
          self._build(zip_file)
        File "/private/var/folders/vl/1y1qg3c911x2hvqbsl7zfpz40000gn/T/pip-build-env-65h215aj/overlay/lib/python3.10/site-packages/poetry/core/masonry/builders/wheel.py", line 135, in _build
          self._run_build_command(setup)
        File "/private/var/folders/vl/1y1qg3c911x2hvqbsl7zfpz40000gn/T/pip-build-env-65h215aj/overlay/lib/python3.10/site-packages/poetry/core/masonry/builders/wheel.py", line 163, in _run_build_command
          subprocess.check_call(
        File "/opt/homebrew/Caskroom/miniforge/base/envs/env3/lib/python3.10/subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/opt/homebrew/Caskroom/miniforge/base/envs/env3/bin/python3.10', '/private/var/folders/vl/1y1qg3c911x2hvqbsl7zfpz40000gn/T/pip-install-j11qco2c/skranger_6ff5d9db353b42c3b49c2a63103f1383/setup.py', 'build', '-b', '/private/var/folders/vl/1y1qg3c911x2hvqbsl7zfpz40000gn/T/pip-install-j11qco2c/skranger_6ff5d9db353b42c3b49c2a63103f1383/build']' 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 skranger
Failed to build skranger
ERROR: Could not build wheels for skranger, which is required to install pyproject.toml-based projects

setuptools seems not to be installed, so I followed most of the steps posted here. However, setuptools was indeed already installed. Could it be, that it stems from this ?

I should mention that I'm installing it into a conda environment on a M1 chip Mac. However, the same error pops up whether I am using arm64 or osx-64 packages.

I would appreciate your help :)

crflynn commented 2 years ago

I haven't yet published wheels for 3.10, so that's why it's attempting to build. But it looks like I should add setuptools to build requires based on that error. Still no guarantee it would install but it seems like it should be there.

robinfallegger commented 2 years ago

Worked with python 3.9, I guess I will stay with that for the moment. It would be very helpful to update to 3.10 at some point though. Thanks for the feedback!

crflynn commented 2 years ago

skranger 0.8.0 has py3.10 wheels, and setuptools has been added to build requirements.