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.15k stars 495 forks source link

[BUG]pyradiomics=3.1.0 failed on linux with python=3.7.16 #831

Open lyhyl opened 1 year ago

lyhyl commented 1 year ago

Describe the bug The lastest pyradiomics=3.1.0 failed on linux, but good on windows.

PyRadiomics configuration N/A

PyRadiomics log file

Error loading C extensions
Traceback (most recent call last):
  File "/home/shery/downloads/anaconda3/yes/envs/pyrad/lib/python3.7/site-packages/radiomics/__init__.py", line 286, in <module>
    from radiomics import _cmatrices as cMatrices  # noqa: F401
ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/shery/downloads/anaconda3/yes/envs/pyrad/lib/python3.7/site-packages/radiomics/__init__.py", line 297, in <module>
    raise e
  File "/home/shery/downloads/anaconda3/yes/envs/pyrad/lib/python3.7/site-packages/radiomics/__init__.py", line 286, in <module>
    from radiomics import _cmatrices as cMatrices  # noqa: F401
ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory

To Reproduce Steps to reproduce the behavior:

  1. conda create -n pyrad python=3.7
  2. conda activate pyrad
  3. pip install pyradiomics
  4. python
  5. import radiomics

Expected behavior import radiomics correctly without error

Version (please complete the following information):

Additional context maybe related to https://github.com/AIM-Harvard/pyradiomics/issues/828 https://github.com/AIM-Harvard/pyradiomics/issues/829?

lyhyl commented 1 year ago

Here need to be update. https://github.com/AIM-Harvard/pyradiomics/blob/6a761c4eb01905cfcb1139b0b158547c55edd4df/pyproject.toml#L7

rcuocolo commented 1 year ago

I'm also having issues updating from 3.0.1 to 3.1.0 on Ubuntu 22.04, similar build errors as those mentioned here. Python 3.10.2

agr78 commented 1 month ago

With Python 3.7.16 on Ubuntu 18.04, the following worked for me:

sudo apt-get install libpython3.7

This problem is addressed in the documentation under Error Loading C Extensions but building from source did not resolve the problem for me, with or without build_ext --inplace during setup.py.