ablab/spades

After upgrading to python3.12 : Error importing LooseVersion from distutils. Now needs to come directly from looseversion.

haslamdb opened this issue · 2 comments

Discussed in #1265

Originally posted by haslamdb March 25, 2024
Hi, I upgraded to python3.12 and was getting the error below when trying to run spades.py. It seems to be because distutils is no longer supported in python3.12 (setuptools is used instead). The workaround was to install looseversion with pip and change the import line in SPAdes-3.15.5-Linux/share/spades/spades_pipeline/support.py"

changed:
from distutils.version import LooseVersion
to:
from looseversion import LooseVersion.

Original error message:Traceback (most recent call last):
File "/usr/local/SPAdes-3.15.5-Linux/bin/spades.py", line 26, in
import support
File "/usr/local/SPAdes-3.15.5-Linux/share/spades/spades_pipeline/support.py", line 23, in
from distutils.version import LooseVersion
ModuleNotFoundError: No module named 'distutils'

asl commented

Hello

You can use next branch that does not contain distutils anymore. This will be a base for the next SPAdes release