Skip to content

[Request] Fixing compatibility issues with newer Python versions #12

@rafisics

Description

@rafisics

Initially, I tried to install eqtools with Python 3.12. But I received the dependency issue:

(py-312) ju@ju ~/eqtools (master)> python setup.py install
Traceback (most recent call last):
  File "/home/ju/eqtools/setup.py", line 1, in <module>
    from numpy.distutils.core import setup, Extension
ModuleNotFoundError: No module named 'numpy.distutils'

With Python 3.11, I installed it. But when testing with the repository's provided script (tests/test.py), I ran into the following issue:

(py-311) ju@ju ~/eqtools (master)> python tests/test.py
Traceback (most recent call last):
  File "/home/ju/.venvs/py-311/lib/python3.11/site-packages/scipy/__init__.py", line 137, in __getattr__
    return globals()[name]
           ~~~~~~~~~^^^^^^
KeyError: 'nan'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ju/eqtools/tests/test.py", line 23, in <module>
    import eqtools
  File "/home/ju/eqtools/eqtools/__init__.py", line 24, in <module>
    from .core import *
  File "/home/ju/eqtools/eqtools/core.py", line 45, in <module>
    from . import trispline
  File "/home/ju/eqtools/eqtools/trispline.py", line 34, in <module>
    class Spline():
  File "/home/ju/eqtools/eqtools/trispline.py", line 78, in Spline
    bounds_error=True, fill_value=scipy.nan
                                  ^^^^^^^^^
  File "/home/ju/.venvs/py-311/lib/python3.11/site-packages/scipy/__init__.py", line 139, in __getattr__
    raise AttributeError(
AttributeError: Module 'scipy' has no attribute 'nan'

After further investigation, I installed scipy==1.10.0 to resolve the error, which allowed the script to run successfully. However, I encountered the following warnings during execution of ``tests/test.py`:

/home/ju/eqtools/eqtools/core.py:48: ModuleWarning: trispline module could not be loaded -- tricubic spline interpolation will not be available.
  warnings.warn("trispline module could not be loaded -- tricubic spline "
/home/ju/eqtools/eqtools/core.py:65: ModuleWarning: matplotlib modules could not be loaded -- plotting and gfile writing will not be available.
  warnings.warn(
(19, 19)

It seems the modules are either missing or not loading properly, which impacts certain functionalities in the library.
Here's versions of my installed packages:

(py-311) ju@ju ~/eqtools (master)> pip list                   
Package           Version
----------------- ------------------
astropy           7.0.1
astropy-iers-data 0.2025.4.21.0.37.6
contourpy         1.3.2
cycler            0.12.1
eqtools           1.4.0
fonttools         4.57.0
h5py              3.13.0
healpy            1.18.1
kiwisolver        1.4.8
matplotlib        3.10.1
mpi4py            4.0.3
numpy             1.26.4
packaging         25.0
pillow            11.2.1
pip               25.0.1
pyerfa            2.0.1.5
pyparsing         3.2.3
python-dateutil   2.9.0.post0
PyYAML            6.0.2
scipy             1.10.0
setuptools        65.5.0
six               1.17.0

And eqtools runs without these errors on Python 3.6, while showing different issues in any version >3.6.

(py-36) ju@ju ~/eqtools (master)> pip list
Package         Version
--------------- -----------
astropy         4.1
cached-property 2.0
cycler          0.11.0
eqtools         1.4.0
h5py            3.1.0
healpy          1.15.0
kiwisolver      1.3.1
matplotlib      3.3.4
mpi4py          4.0.3
numpy           1.19.5
Pillow          8.4.0
pip             21.3.1
pyparsing       3.1.4
python-dateutil 2.9.0.post0
scipy           1.5.4
setuptools      40.6.2
six             1.17.0

Looking forward to resolving the eqtools compatibility issues with the modern Python versions.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions