bxlab / metaWRAP

MetaWRAP - a flexible pipeline for genome-resolved metagenomic data analysis
MIT License
396 stars 190 forks source link

ImportError: cannot import name GMM #55

Open SilentGene opened 6 years ago

SilentGene commented 6 years ago

Hi, I just encountered an error when trying to get bins with CONCOCT using the latest metaWRAP, while I can run MetaBAT2 and MaxBin2 fluently. Here is the log:

------------------------------------------------------------------------------------------------------------------------
-----                            Starting binning with CONCOCT. This may take a while...                           -----
------------------------------------------------------------------------------------------------------------------------

/home/heyu/miniconda2/envs/metawrap-env/lib/python2.7/site-packages/sklearn/utils/fixes.py:313: FutureWarning: numpy not_equal will not check object identity in the future. The comparison did not return the same result as suggested by the identity (`is`)) and will change.
  _nan_object_mask = _nan_object_array != _nan_object_array
Traceback (most recent call last):
  File "/home/heyu/miniconda2/envs/metawrap-env/bin/concoct", line 4, in <module>
    __import__('pkg_resources').run_script('concoct==0.4.0', 'concoct')
  File "/home/heyu/miniconda2/envs/metawrap-env/lib/python2.7/site-packages/pkg_resources/__init__.py", line 661, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/heyu/miniconda2/envs/metawrap-env/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1441, in run_script
    exec(code, namespace, namespace)
  File "/home/heyu/miniconda2/envs/metawrap-env/lib/python2.7/site-packages/concoct-0.4.0-py2.7-linux-x86_64.egg/EGG-INFO/scripts/concoct", line 10, in <module>
    from concoct.cluster import cluster
  File "/home/heyu/miniconda2/envs/metawrap-env/lib/python2.7/site-packages/concoct-0.4.0-py2.7-linux-x86_64.egg/concoct/cluster.py", line 4, in <module>
    from sklearn.mixture import GMM
ImportError: cannot import name GMM

************************************************************************************************************************
*****                           Something went wrong with binning with CONCOCT. Exiting.                           *****
************************************************************************************************************************

In the meanwhile, a friend of mine also encountered the same problem in his environment.

SilentGene commented 6 years ago

Hi, I have just found a solution to this problem. That is due to the reason that GMM cannot be imported in scikit-learn 20.0. I have made the scikit-learn 16.0 version in the conda environment, and it worked. Here is the code:

conda install scikit-learn=0.16.1
conda install libopenblas

Hope that would be helpful.

Cheers, H

ursky commented 6 years ago

Sorry for the late response - I was on vacation. Thank you for the feedback, and for the fix. I updated the conda requirements to require these packages. The changes will take effect in metaWRAP v=1.03.

25280841 commented 5 years ago

Thanks! I solved it! I reinstalled by using " conda install metawrap-mg " after I set the channels as the installation. I'm using both 1.02 and 1.05 on a virtual machine and a cluster of centos6.9. The version I encontered this problem was 1.04?

From: German Uritskiy Date: 2018-12-21 21:56 To: tangzhixi@ibcas.ac.cn Subject: Re: Problems on "CONCOCT" in metaWRAP Hi Tang, I would appreciate it if you could open a github issue for this so everyone can see and benefit. Looks to be the same error as here: https://github.com/bxlab/metaWRAP/issues/55 although i thought I patched it. What version of metawrap are you using. Did you by any chance install with bioconda?

On Dec 21, 2018, at 7:16 AM, tangzhixi@ibcas.ac.cn wrote:

Dear Gherman V. Uritskiy: I'm an user of metaWRAP, I love this software; It's easy for us to do some analysis about metagenome. But I encountered an error on "concoct" while binning! I tried to solve it but fialed. Could you help me to solve it? Many thanks! I‘m using CentOS 6.9, and installed the metaWRAP using Anaconda, python version is 2.7.15. The following is the error information:

Traceback (most recent call last): File "/nfs/data/tzhx/Anaconda3/envs/metawrap/bin/concoct", line 4, in import('pkg_resources').run_script('concoct==0.4.0', 'concoct') File "/nfs/data/tzhx/Anaconda3/envs/metawrap/lib/python2.7/site-packages/pkg_resources/init.py", line 661, in run_script self.require(requires)[0].run_script(script_name, ns) File "/nfs/data/tzhx/Anaconda3/envs/metawrap/lib/python2.7/site-packages/pkg_resources/init.py", line 1441, in run_script exec(code, namespace, namespace) File "/nfs/data/tzhx/Anaconda3/envs/metawrap/lib/python2.7/site-packages/concoct-0.4.0-py2.7-linux-x86_64.egg/EGG-INFO/scripts/concoct", line 10, in from concoct.cluster import cluster File "/nfs/data/tzhx/Anaconda3/envs/metawrap/lib/python2.7/site-packages/concoct-0.4.0-py2.7-linux-x86_64.egg/concoct/cluster.py", line 4, in from sklearn.mixture import GMM ImportError: cannot import name GMM

 Best wishes!

Tang zhixi 2018-12-21 Institue of Botany, Chinese Acdemy of Scienses. Beijing, China 唐治喜 tangzhixi@ibcas.ac.cn