pyradiomics icon indicating copy to clipboard operation
pyradiomics copied to clipboard

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

Open goncinious opened this issue 2 years ago • 9 comments

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):

  • OS: Ubuntu 20.04.3 LTS
  • Python version: 3.9
  • PyRadiomics version 3.0.1

Additional context pyradiomics_install.log

goncinious avatar Sep 12 '22 13:09 goncinious

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

goncinious avatar Sep 12 '22 13:09 goncinious

+1

andreasala98 avatar Sep 12 '22 14:09 andreasala98

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

intervall-ludger avatar Sep 26 '22 09:09 intervall-ludger

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

dsantiago avatar Oct 11 '22 14:10 dsantiago

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...

JoostJM avatar Oct 28 '22 09:10 JoostJM

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.

dsantiago avatar Nov 21 '22 13:11 dsantiago

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 avatar Dec 07 '22 23:12 dorkylever

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 avatar Mar 21 '23 01:03 dorkylever

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

dorkylever avatar May 24 '23 05:05 dorkylever