DaehwanKimLab / centrifuge

Classifier for metagenomic sequences
GNU General Public License v3.0
246 stars 73 forks source link

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

Open papanikos opened 3 months ago

papanikos commented 3 months ago

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.

mourisl commented 3 months ago

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

papanikos commented 2 months ago

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

Fixed with c68c367c620c31a61a037deb9013742c50123d6c