AIM-Harvard / pyradiomics

Open-source python package for the extraction of Radiomics features from 2D and 3D images and binary masks. Support: https://discourse.slicer.org/c/community/radiomics
http://pyradiomics.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.11k stars 485 forks source link

Error in building wheel for simple ITK #873

Open ManonBakker99 opened 3 months ago

ManonBakker99 commented 3 months ago

When I try to run the python -m pip install pyradiomics in the command prompt it works almost perfect. However, when building wheels for collected packages: SimpleITK it results in the following error: Building wheel for SimpleITK (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for SimpleITK (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [356 lines of output]

scikit-build could not get a working generator for your system. Aborting build.

                  Building windows wheels for Python 3.7 requires Microsoft Visual Studio 2022.
  Get it with "Visual Studio 2017":

    https://visualstudio.microsoft.com/vs/

  Or with "Visual Studio 2019":

      https://visualstudio.microsoft.com/vs/

  Or with "Visual Studio 2022":

      https://visualstudio.microsoft.com/vs/

                  ********************************************************************************
  [end of output]

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

It is unable to further process because there seems to be a missing visual studio version. However I do have visual studio 2022 installed on my laptop. How do I solve this issue? or is there another way to install or use the pyradiomics tool.

joaoluizcarvalho commented 2 months ago

I was having the same issue on Windows 10. I tried both Python 3.7.0 and 3.7.9.

I was able to finish installation of pyradiomics without errors on Python 3.7.0 by running pip install SimpleITK==2.2.1 before running pip install pyradiomics.

However, I still can't get pyradiomics to run. When I run pyradiomics -h, I get the following error:

'pyradiomics' is not recognized as an internal or external command, operable program or batch file.

barrettMCW commented 1 month ago

SimpleITK no longer supports python 3.7, should be resolved by using using an older version of SimpleITK as mentioned by @joaoluizcarvalho or, better yet, use python3.8+. Python3.7 reached EOL almost a year ago and python3.8 is starting to get there.

@joaoluizcarvalho that's gotta be a path issue, but not too sure on how that all works in windows.