Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: metaclass conflict #100

Open
laczik-git opened this issue Mar 28, 2024 · 9 comments
Open

TypeError: metaclass conflict #100

laczik-git opened this issue Mar 28, 2024 · 9 comments

Comments

@laczik-git
Copy link

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
from checkm2 import predictQuality
File "/anaconda3/miniforge-install/envs/checkm2/lib/python3.6/site-packages/checkm2/predictQuality.py", line 1, in
from checkm2 import modelProcessing
File "/anaconda3/miniforge-install/envs/checkm2/lib/python3.6/site-packages/checkm2/modelProcessing.py", line 17, in
from tensorflow import keras
File "/anaconda3/miniforge-install/envs/checkm2/lib/python3.6/site-packages/tensorflow/init.py", line 41, in
from tensorflow.python.tools import module_util as _module_util
File "/anaconda3/miniforge-install/envs/checkm2/lib/python3.6/site-packages/tensorflow/python/init.py", line 41, in
from tensorflow.python.eager import context
File "/anaconda3/miniforge-install/envs/checkm2/lib/python3.6/site-packages/tensorflow/python/eager/context.py", line 28, in
from absl import logging
File "/anaconda3/miniforge-install/envs/checkm2/lib/python3.6/site-packages/absl/logging/init.py", line 97, in
from absl import flags
File "/anaconda3/miniforge-install/envs/checkm2/lib/python3.6/site-packages/absl/flags/init.py", line 35, in
from absl.flags import _argument_parser
File "/anaconda3/miniforge-install/envs/checkm2/lib/python3.6/site-packages/absl/flags/_argument_parser.py", line 82, in
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

conda version: 23.3.1
mamba version: 1.4.2
Python 3.6.15

@bartns
Copy link

bartns commented Apr 2, 2024

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

@laczik-git
Copy link
Author

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

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!

@bartns
Copy link

bartns commented Apr 2, 2024

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

@schmigle
Copy link

schmigle commented May 6, 2024

For me, simply explicitly updating to Python 3.8 in Mamba solved this bug:
mamba install python=3.8

@RolandWirth
Copy link

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

@chklovski
Copy link
Owner

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.

@matao0229
Copy link

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

@rrohwer
Copy link

rrohwer commented Sep 7, 2024

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 #82 (comment) 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

@zehanna
Copy link

zehanna commented Oct 11, 2024

I had the same issue after using conda for installation, and updating to python=3.8 solved the issue for me as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants