DaehwanKimLab/centrifuge

centrifuge-inspect python script is incompatible with python >=3.12

Closed this issue · 4 comments

The centrifuge-inspect script uses the imp module which has been removed in python 3.12 (https://docs.python.org/dev/whatsnew/3.12.html#imp).

This also causes centrifuge-kreport to produce wrong output, since it doesn't really fail.

Loading taxonomy ...
Loading names file ...
Traceback (most recent call last):
  File "/home/nikos/miniforge3/envs/ncbi/bin/centrifuge-inspect", line 24, in <module>
    import imp
ModuleNotFoundError: No module named 'imp'
Loading nodes file ...
Traceback (most recent call last):
  File "/home/nikos/miniforge3/envs/ncbi/bin/centrifuge-inspect", line 24, in <module>
    import imp
ModuleNotFoundError: No module named 'imp'
Couldn't find parent of taxID 10794 - directly assigned to root.
Couldn't find parent of taxID 10794 - directly assigned to root.

Downgrading python version to anything <3.12 seems to resolve the issue.

Thank you for reporting this issue! I have removed the dependency on the imp module.

Cool! Not sure how you handle issues, but as far as I am concerned this one can be closed.

Fixed with c68c367

@mourisl, could you please issue a new Centrifuge point release, since Python 3.12 was released a few weeks ago? See https://www.python.org/downloads/release/python-3120/ (Python 3.12.0, Release Date: Oct. 2, 2023) and https://docs.python.org/3.12/whatsnew/3.12.html#imp. Thanks!

Yes. I have made the release v1.0.4.2. The bioconda version should be automatically updated soon.