Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] #886

Open
hmpaverd opened this issue Jun 27, 2024 · 2 comments
Open

[BUG] #886

hmpaverd opened this issue Jun 27, 2024 · 2 comments
Labels

Comments

@hmpaverd
Copy link

Describe the bug
Installing from source fails because of what appears to be an issue with Versioneer (possible incompatibility with Python 3.12).

PyRadiomics log file
After cloning the git repo and running python3 setup.py install, I get the following error:

/Users/user/Work/pyradiomics/versioneer.py:418: SyntaxWarning: invalid escape sequence '\s'
LONG_VERSION_PY['git'] = '''
Traceback (most recent call last):
File "/Users/user/Work/pyradiomics/setup.py", line 24, in
version=versioneer.get_version(),
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/user/Work/pyradiomics/versioneer.py", line 1476, in get_version
return get_versions()["version"]
^^^^^^^^^^^^^^
File "/Users/user/Work/pyradiomics/versioneer.py", line 1408, in get_versions
cfg = get_config_from_root(root)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/user/Work/pyradiomics/versioneer.py", line 342, in get_config_from_root
parser = configparser.SafeConfigParser()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'?

Version (please complete the following information):

  • OS: macOS 14.5
  • Python version: 3.12.2
  • PyRadiomics version: master branch
@hmpaverd hmpaverd added the bug label Jun 27, 2024
@TK-A369
Copy link

TK-A369 commented Jul 3, 2024

I also had trouble with installing pyradiomics.
I'm on Windows 10. I have Python 3.12.3 installed.
Firstly I tried to install it via pip, and I got same error as you.
Then I attempted to use older Python version (3.7.17, compiled from source on Windows) or Anaconda, but I still had some issues with (if I remember correctly) NumPy or Jupyter lab.
Finally, same as you, I cloned pyradiomics repo and tried to install it from source. I got same error as you, and same as when using pip. I modified setup.py file by commenting out versioneer related stuff:

#!/usr/bin/env python

from distutils import sysconfig
import platform

import numpy
from setuptools import Extension, setup
# import versioneer

if platform.architecture()[0].startswith('32'):
  raise Exception('PyRadiomics requires 64 bits python')

# commands = versioneer.get_cmdclass()
incDirs = [sysconfig.get_python_inc(), numpy.get_include()]

ext = [Extension("radiomics._cmatrices", ["radiomics/src/_cmatrices.c", "radiomics/src/cmatrices.c"],
                 include_dirs=incDirs),
       Extension("radiomics._cshape", ["radiomics/src/_cshape.c", "radiomics/src/cshape.c"],
                 include_dirs=incDirs)]

setup(
  name='pyradiomics',

  # version=versioneer.get_version(),
  # cmdclass=commands,

  packages=['radiomics', 'radiomics.scripts'],
  ext_modules=ext,
  zip_safe=False
)

After this, I was able to succesfully install pyradiomics. And apparently it works.
Yes, I know, this is ugly workaround.

@hmpaverd
Copy link
Author

Thank you so much for commenting! I found the same problem with the versioneer file - I think I ended up installing it directly from source and omitting in the set-up file (like you), as it uses a deprecated python function. It would be great if the authors could fix it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants