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.14k stars 492 forks source link

[BUG] `pyradiomics` fails to install on Python 3.9 #787

Open goncinious opened 1 year ago

goncinious commented 1 year ago

Describe the bug

There's no pyradiomics wheel for Python 3.9, therefore the package needs to be built from sdist. However, since build system requirements according to PEP-518 are missing, the build fails with the following error message below (full stack trace attached).

(pyrad_env) # pip install pyradiomics
Collecting pyradiomics
  Downloading pyradiomics-3.0.1.tar.gz (34.5 MB)
     |████████████████████████████████| 34.5 MB 30.8 MB/s 
    ERROR: Command errored out with exit status 1:
     command: /srv/science/test_env/pyrad_env/pyrad_env/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-kcw59gkz/pyradiomics/setup.py'"'"'; __file__='"'"'/tmp/pip-install-kcw59gkz/pyradiomics/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-kcw59gkz/pyradiomics/pip-egg-info
         cwd: /tmp/pip-install-kcw59gkz/pyradiomics/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-kcw59gkz/pyradiomics/setup.py", line 7, in <module>
        import numpy
    ModuleNotFoundError: No module named 'numpy'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

To Reproduce Steps to reproduce the behavior:

Create Python 3.9 env and install pyradiomics using pip.

python -m venv pyrad_env
source pyrad_env/bin/activate
pip install pyradiomics -vvv

Reference issue (originally published in Poetry): https://github.com/python-poetry/poetry/issues/6484

Expected behavior

Could you please add Python 3.9 wheels or update setup.py to conform with PEP-518?

Version (please complete the following information):

Additional context pyradiomics_install.log

goncinious commented 1 year ago

Relates to https://github.com/AIM-Harvard/pyradiomics/issues/653

andreasala98 commented 1 year ago

+1

intervall-ludger commented 1 year ago

Pyradiomics requires Python 3.7, unfortunately the framework has not been updated to newer versions for a long time.

dsantiago commented 1 year ago

Yeah, we are going to 3.11 soon, maybe the framework can do a catch up to maybe 3.9 or 3.10.

JoostJM commented 1 year ago

I am planning to do a new release soon, supporting the newest python versions. This has not already been done so, as I've been encountering some issues with the CI integration. Especially conda is a nightmare for CI...

dsantiago commented 1 year ago

I am planning to do a new release soon, supporting the newest python versions. This has not already been done so, as I've been encountering some issues with the CI integration. Especially conda is a nightmare for CI...

Good to know @JoostJM, as I am learning now radiomics and stuff for my masters, I can't do much... but in a near future, when I will be more confortable with it, I can contribute also.

dorkylever commented 1 year ago

Hi @JoostJM is there any update to the timeline for the newer version release? Pyradiomics is currenting the limiting package to upgrade my python version.

dorkylever commented 1 year ago

Hi Joost and Ludger,

Has there been any updates to the framework to support newer python versions?

I'm starting to run into a lot of issues that I believe is due to the python version.

  1. Later ubuntu versions (e.g. Ubuntu 20.0.4 LTS) now have python 3.8 or later installed by default. This means that you have to add the deadsnakes ppa repository and sometimes I have issues get this to work on some systems.

  2. Anaconda / Conda envs are now installing pip v22.3.1 by default (even when python 3.17.16 is specified). So you can run pip installs and they work but using setup.py install --user now causes it to require Python 3.8 for some reason (unless you're like me and have that one reliable conda env that works for years). I've played with the version of pip (went down to 20.3) and setuptools (down to 58.0.4) in the conda env and that didn't seem to fix the issue. This is a recent issue I've begun to encounter at the end of last year / start of this year so I'm not sure what's changed.

Is there another dependency that you're using that requires python 3.7 or is it that you're unable to check the newer versions due to conda issues? Let me know what you think - I realise these things are pretty tough.

Kind Regards, Kyle

dorkylever commented 1 year ago

Thank you so much for updating the underlying python dependencies!!