CheckM2
CheckM2 copied to clipboard
TypeError: metaclass conflict
Hi,
I'm having the following issue when trying to run checkm2:
$ checkm2 database --download --path ./
Traceback (most recent call last):
File "/anaconda3/miniforge-install/envs/checkm2/bin/checkm2", line 27, in
conda version: 23.3.1 mamba version: 1.4.2 Python 3.6.15
Having the same issue when installing from conda (mamba):
mamba create -n checkm2 -c bioconda -c conda-forge checkm2
Installing using the yml file works fine though (with mamba):
mamba env create -n checkm2 -f checkm2.yml
mamba activate checkm2
and pip install CheckM2
Having the same issue when installing from conda (mamba):
mamba create -n checkm2 -c bioconda -c conda-forge checkm2
Installing using the yml file works fine though (with mamba):
mamba env create -n checkm2 -f checkm2.yml
mamba activate checkm2
andpip install CheckM2
Thank You!
I would say it worked like a charm, but I had to tinker with DIAMOND to make it work. First, I got this issue:
Illegal instruction ERROR: Error: DIAMOND failed to generate output.
I decided to update Diamond with mamba update, which resolved the previous error, bringing up a new one:
Segmentation fault ERROR: No DIAMOND annotation was generated. Exiting
So I obliterated DIAMOND with conda remove and reinstalled the previous version 2.1.8 Now, it works like a charm.
Thanks again!
Good that you got it working.
In my case it installs the diamond as it should from yaml file: - diamond=2.0.4
which diamond
: /home/bart/miniforge3/envs/checkm2/bin/diamond
and it's version:
diamond version
gives
diamond version 2.0.4
For me, simply explicitly updating to Python 3.8 in Mamba solved this bug: mamba install python=3.8
It seems the problem is the diamond 2.0.4 itself. It may be necessary to update to 2.1.8 in the dependencies. I also tried to manually remove and reinstall DIAMOND with version 2.1.8, and it fixed the "DIAMOND failed to generate output" problem. This problem occured not just in the testrun but also in the predict workflow. So, the reinstalling solved the problem.
conda version: 23.3.1 mamba version: 1.4.2 Python 3.8.19
Next version will update to most recent DIAMOND release and reformat the database to work with that so that will hopefully fix some of these issues.
Even if I updated diamond to 2.1.8 or 2.1.9, this problem (metaclass conflict) still could not be solved... conda 24.5.0 mamba 1.5.8 Python 3.6.15
I also had this issue after installing with mamba and was able to fix with the python update suggested here as well as in issue #82 . No need to adjust diamond. I also suggest you update the installation instructions as suggested by https://github.com/chklovski/CheckM2/issues/82#issuecomment-1804166388 as that is a simple fix that does not need to wait for an updated version or any other changes!
$ mamba create --name checkm2_v1.0.2 -c bioconda -c conda-forge checkm2
$ mamba activate checkm2_v1.0.2
$ checkm2 -h
Traceback (most recent call last):
File "/work/08922/rrohwer/ls6/miniforge3/envs/checkm2_v1.0.2/bin/checkm2", line 27, in <module>
from checkm2 import predictQuality
File "/work/08922/rrohwer/ls6/miniforge3/envs/checkm2_v1.0.2/lib/python3.6/site-packages/checkm2/predictQuality.py", line 1, in <module>
from checkm2 import modelProcessing
File "/work/08922/rrohwer/ls6/miniforge3/envs/checkm2_v1.0.2/lib/python3.6/site-packages/checkm2/modelProcessing.py", line 17, in <module>
from tensorflow import keras
File "/work/08922/rrohwer/ls6/miniforge3/envs/checkm2_v1.0.2/lib/python3.6/site-packages/tensorflow/__init__.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "/work/08922/rrohwer/ls6/miniforge3/envs/checkm2_v1.0.2/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 41, in <module>
from tensorflow.python.eager import context
File "/work/08922/rrohwer/ls6/miniforge3/envs/checkm2_v1.0.2/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 28, in <module>
from absl import logging
File "/work/08922/rrohwer/ls6/miniforge3/envs/checkm2_v1.0.2/lib/python3.6/site-packages/absl/logging/__init__.py", line 97, in <module>
from absl import flags
File "/work/08922/rrohwer/ls6/miniforge3/envs/checkm2_v1.0.2/lib/python3.6/site-packages/absl/flags/__init__.py", line 35, in <module>
from absl.flags import _argument_parser
File "/work/08922/rrohwer/ls6/miniforge3/envs/checkm2_v1.0.2/lib/python3.6/site-packages/absl/flags/_argument_parser.py", line 82, in <module>
class ArgumentParser(Generic[_T], metaclass=_ArgumentParserCache):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
$ mamba install python=3.8
$ checkm2 -h
____ _ _ __ __ ____
/ ___| |__ ___ ___| | _| \/ |___ \
| | | '_ \ / _ \/ __| |/ / |\/| | __) |
| |___| | | | __/ (__| <| | | |/ __/
\____|_| |_|\___|\___|_|\_\_| |_|_____|
...::: CheckM2 v1.0.2 :::...
General usage:
predict -> Predict the completeness and contamination of genome bins in a folder. Example usage:
checkm2 predict --threads 30 --input <folder_with_bins> --output-directory <output_folder>
testrun -> Runs Checkm2 on internal test genomes to ensure it runs without errors. Example usage:
checkm2 testrun --threads 10
database -> Download and set up required CheckM2 DIAMOND database for annotation
Use checkm2 <command> -h for command-specific help.
Thank you! Robin
I had the same issue after using conda for installation, and updating to python=3.8 solved the issue for me as well :)