skgrf icon indicating copy to clipboard operation
skgrf copied to clipboard

Installation error: building wheel fails

Open maikemp opened this issue 2 years ago • 7 comments

Hi, thank you so much for developing this package. Unfortunately, I am running into a bit of a problem with the installation via 'pip install skgrf'. I have tried it in multiple environments with various python versions (all >= 3.7.10) on two different systems, and I always received more or less the same error message. I would really appreciate any advice on how to overcome this problem.

The full error message (with Python version 3.8.13) is:

Collecting skgrf
  Using cached skgrf-0.3.0.tar.gz (1.8 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting scikit-learn<1.0,>=0.23.0
  Using cached scikit_learn-0.24.2-cp38-cp38-win_amd64.whl (6.9 MB)
Requirement already satisfied: scipy>=0.19.1 in c:\user\anaconda3\envs\test_pkgs\lib\site-packages (from scikit-learn<1.0,>=0.23.0->skgrf) (1.9.3)
Requirement already satisfied: joblib>=0.11 in c:\user\anaconda3\envs\test_pkgs\lib\site-packages (from scikit-learn<1.0,>=0.23.0->skgrf) (1.2.0)
Requirement already satisfied: threadpoolctl>=2.0.0 in c:\user\anaconda3\envs\test_pkgs\lib\site-packages (from scikit-learn<1.0,>=0.23.0->skgrf) (3.1.0)
Requirement already satisfied: numpy>=1.13.3 in c:\user\anaconda3\envs\test_pkgs\lib\site-packages (from scikit-learn<1.0,>=0.23.0->skgrf) (1.23.4)
Building wheels for collected packages: skgrf
  Building wheel for skgrf (pyproject.toml): started
  Building wheel for skgrf (pyproject.toml): finished with status 'error'
Failed to build skgrf
Note: you may need to restart the kernel to use updated packages.
  error: subprocess-exited-with-error
  
  Building wheel for skgrf (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 "C:\User\AppData\Local\Temp\pip-install-g5fwsbx8\skgrf_aa7c8fee85a9467799deccfdcd073228\setup.py", line 2, in <module>
      from setuptools import setup
  ModuleNotFoundError: No module named 'setuptools'
  Traceback (most recent call last):
    File "C:\User\Anaconda3\envs\test_pkgs\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
      main()
    File "C:\User\Anaconda3\envs\test_pkgs\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\User\Anaconda3\envs\test_pkgs\lib\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 "C:\User\AppData\Local\Temp\pip-build-env-uyym_whd\overlay\Lib\site-packages\poetry\core\masonry\api.py", line 67, in build_wheel
      return WheelBuilder.make_in(poetry, Path(wheel_directory))
    File "C:\User\AppData\Local\Temp\pip-build-env-uyym_whd\overlay\Lib\site-packages\poetry\core\masonry\builders\wheel.py", line 80, in make_in
      wb.build(target_dir=directory)
    File "C:\User\AppData\Local\Temp\pip-build-env-uyym_whd\overlay\Lib\site-packages\poetry\core\masonry\builders\wheel.py", line 114, in build
      self._build(zip_file)
    File "C:\User\AppData\Local\Temp\pip-build-env-uyym_whd\overlay\Lib\site-packages\poetry\core\masonry\builders\wheel.py", line 168, in _build
      self._run_build_command(setup)
    File "C:\User\AppData\Local\Temp\pip-build-env-uyym_whd\overlay\Lib\site-packages\poetry\core\masonry\builders\wheel.py", line 206, in _run_build_command
      subprocess.check_call(
    File "C:\User\Anaconda3\envs\test_pkgs\lib\subprocess.py", line 364, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['C:/User/Anaconda3/envs/test_pkgs/python.exe', 'C:\\User\\AppData\\Local\\Temp\\pip-install-g5fwsbx8\\skgrf_aa7c8fee85a9467799deccfdcd073228\\setup.py', 'build', '-b', 'C:\\User\\AppData\\Local\\Temp\\pip-install-g5fwsbx8\\skgrf_aa7c8fee85a9467799deccfdcd073228\\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 skgrf
ERROR: Could not build wheels for skgrf, which is required to install pyproject.toml-based projects

maikemp avatar Oct 25 '22 08:10 maikemp

Your system is trying to build the wheel for skgrf. Am I correct in assuming you are on an M1 mac? We ship wheels for linux and mac but not yet for M1 macs, so it's attempting to build from source.

In your error it says ModuleNotFoundError: No module named 'setuptools' Have you tried pip install setuptools? This should get you past the error and it will attempt to build the wheel.

crflynn avatar Oct 25 '22 16:10 crflynn

Hi, thanks a lot for your quick response. No, I am on Windows (10). I have actually tried that but setuptools is already installed. I also tried updating this and other packages but it is still the same error.

maikemp avatar Oct 25 '22 16:10 maikemp

I'm not sure why it wouldn't pick up setuptools after installing it. I will say that even if you get past that error, I'm not sure whether or not it will build for windows, since we don't explicitly test or build on windows platforms here.

I've tried in the past but haven't gotten it to work. Unfortunately the logs have expired and I don't recall what the exact issue was: https://github.com/crflynn/skgrf/pull/89

crflynn avatar Oct 25 '22 19:10 crflynn

Alright, thanks for the info.

maikemp avatar Oct 26 '22 15:10 maikemp

Please test on Windows 10 as well. I have the same issue.

aveshd avatar May 18 '23 19:05 aveshd

I am also having this error. Setup.py can't find setup tools. Disappointing to discover this package is completely unusable for windows.

ZTaylor12 avatar Jun 16 '23 21:06 ZTaylor12

Please fix it, I use this package on Mac and it works great and now I've moved to Windows and cannot run my code bevause of this error

RemiKhellaf avatar Jul 11 '23 09:07 RemiKhellaf