ANTsX / ANTsR

R interface to the ANTs biomedical image processing library
https://antsx.github.io/ANTsR
Apache License 2.0
127 stars 35 forks source link

Python 2.7 Error #403

Open jonesnat opened 2 weeks ago

jonesnat commented 2 weeks ago

Describe the bug I am getting a PyType_GetFlags error when I type this command: mdl = getBrainAgeModel( tempfile() ) in R.

Below is the error message: Error: PyType_GetFlags - /usr/lib64/python2.7/config/libpython2.7.so: undefined symbol: PyType_GetFlags

To Reproduce Steps to reproduce the behavior:

  1. Load Python 3.10 and R 4.3.1
  2. Start R session
  3. Load required libraries in R: brainAgeR, ANTsR, tensorflow, keras
  4. Type filename = system.file("extdata", "test_image.nii.gz", package = "brainAgeR", mustWork = TRUE)
  5. Type img = antsImageRead( filename )
  6. Run getBrainAgeModel command: mdl = getBrainAgeModel( tempfile() )
  7. See error

Expected behavior Not get the error message

Desktop (please complete the following information):

Additional context Since Python2.7 is deprecated is there a plan to update to Python3?

ncullen93 commented 1 week ago

Can you provide more context on the interplay between R and Python here - What do you mean by "Load Python 3.10.." ? Are you calling R from within Python, or vice-versa? I don't understand why you would get a Python error in ANTsR otherwise.

And in any case - we don't support Python2.7 in ANTsPy anymore.