RECETOX / RIAssigner

RIAssigner is a python tool for retention index (RI) computation for GC-MS data.
MIT License
4 stars 6 forks source link

Dependency issues (pint and numpy) #96

Closed xtrojak closed 1 year ago

xtrojak commented 1 year ago

The newest pint version (v0.20) broke its API my moving unit functions to a different location. Therefore, the particular import fails on:

RIAssigner/data/Data.py:5: in <module>
    from pint.unit import build_unit_class
ModuleNotFoundError: No module named 'pint.unit'

https://github.com/RECETOX/RIAssigner/blob/85bacb3678caaa4978339270c91bafe3fff4f8ba/RIAssigner/data/Data.py#L5

The easiest way to resolve this would be by pinpointing the version of pint to v0.19.2. Another possibility is to update the import path for build_unit_class, but using the v0.20+ version of pint also allows to use newer version of numpy (v1.24.1 in particular), which causes another import issue not present when using v1.23.5:

  File "/usr/local/lib/python3.8/site-packages/RIAssigner/data/MatchMSData.py", line 3, in <module>
    from matchms import Spectrum
  File "/usr/local/lib/python3.8/site-packages/matchms/__init__.py", line 1, in <module>
    from . import exporting, filtering, importing, networking, plotting, similarity
  File "/usr/local/lib/python3.8/site-packages/matchms/importing/__init__.py", line 23, in <module>
    from .load_scores import scores_from_json, scores_from_pickle
  File "/usr/local/lib/python3.8/site-packages/matchms/importing/load_scores.py", line 2, in <module>
    from matchms.Scores import ScoresBuilder
  File "/usr/local/lib/python3.8/site-packages/matchms/Scores.py", line 7, in <module>
    from sparsestack import StackedSparseArray
  File "/usr/local/lib/python3.8/site-packages/sparsestack/__init__.py", line 2, in <module>
    from .StackedSparseArray import StackedSparseArray
  File "/usr/local/lib/python3.8/site-packages/sparsestack/StackedSparseArray.py", line 5, in <module>
    from .utils import join_arrays
  File "/usr/local/lib/python3.8/site-packages/sparsestack/utils.py", line 1, in <module>
    import numba
  File "/usr/local/lib/python3.8/site-packages/numba/__init__.py", line 43, in <module>
    from numba.np.ufunc import (vectorize, guvectorize, threading_layer,
  File "/usr/local/lib/python3.8/site-packages/numba/np/ufunc/__init__.py", line 3, in <module>
    from numba.np.ufunc.decorators import Vectorize, GUVectorize, vectorize, guvectorize
  File "/usr/local/lib/python3.8/site-packages/numba/np/ufunc/decorators.py", line 3, in <module>
    from numba.np.ufunc import _internal
SystemError: initialization of _internal failed without raising an exception
xtrojak commented 1 year ago

To be more precise, the bioconda package pinned the pint dependency here, but we also need to update dev conda env config here in the repo. However, the numpy version needs to be pinned then, too, to a range 1.18 - 1.23.