ModuleNotFoundError: No module named 'sklearn.ensemble._forest'

2,840 views
Skip to first unread message

jonatho...@icloud.com

unread,
Jan 11, 2021, 12:02:25 PM1/11/21
to Anvi'o
```
$ anvi-self-test --version
Anvi'o .......................................: hope (v7-dev)

Profile database .............................: 35
Contigs database .............................: 20
Pan database .................................: 14
Genome data storage ..........................: 7
Auxiliary data storage .......................: 2
Structure database ...........................: 2
Metabolic modules database ...................: 2
tRNA-seq database ............................: 1
```

Hello Anvi'o team,
Using the master version, I am now having the following error when running a number of commands:

```
$ anvi-summarize -p JCVI_27_bin.3.profile/PROFILE.db -c JCVI_27_bin.3.contigs.db -C DEFAULT -o merged_summary
Contigs DB ...................................: Initialized: JCVI_27_bin.3.contigs.db (v. 20)                                                           
                                                                                                                                                                                                 
WARNING
===============================================
ProfileSuperClass found a collection focus, which means it will be initialized
using only the splits in the profile database that are affiliated with the
collection DEFAULT and all bins it describes.

Auxiliary Data ...............................: Found: JCVI_27_bin.3.profile/AUXILIARY-DATA.db (v. 2)                                                   
Profile Super ................................: Initialized with 92 of 92 splits: JCVI_27_bin.3.profile/PROFILE.db (v. 35)
                                                                                                                                                                                                 
THE MORE YOU KNOW 🌈
===============================================
Someone asked the Contigs Superclass to initialize only a subset of contig
sequences. Usually this is a good thing and means that some good code somewhere
is looking after you. Just FYI, this class will only know about 67 contig
sequences instead of all the things in the database.

                                                                                                                                                                                                 
* FYI: A subset of split sequences are being initialized (92 of 92 the contigs
database knows about, to be precise). Nothing to worry about. Probably.

Traceback (most recent call last):                                                                                                                                                               
  File "/usr/local/projdata/0718/projects/jon/conda_envs/github/anvio/bin/anvi-summarize", line 123, in <module>
    main(args)
  File "/usr/local/projdata/0718/projects/jon/conda_envs/github/anvio/bin/anvi-summarize", line 69, in main
    summary.process()
  File "/usr/local/projdata/0718/projects/jon/conda_envs/github/anvio/anvio/summarizer.py", line 865, in process
    self.init()
  File "/usr/local/projdata/0718/projects/jon/conda_envs/github/anvio/anvio/summarizer.py", line 765, in init
    self.completeness = completeness.Completeness(self.contigs_db_path)
  File "/usr/local/projdata/0718/projects/jon/conda_envs/github/anvio/anvio/completeness.py", line 45, in __init__
    self.SCG_domain_predictor = scgdomainclassifier.Predict(argparse.Namespace(), run=terminal.Run(verbose=False), progress=self.progress)
  File "/usr/local/projdata/0718/projects/jon/conda_envs/github/anvio/anvio/scgdomainclassifier.py", line 234, in __init__
    SCGDomainClassifier.__init__(self, args, run, progress)
  File "/usr/local/projdata/0718/projects/jon/conda_envs/github/anvio/anvio/scgdomainclassifier.py", line 73, in __init__
    self.rf.initialize_classifier()
  File "/usr/local/projdata/0718/projects/jon/conda_envs/github/anvio/anvio/learning.py", line 103, in initialize_classifier
    classifier_obj = pickle.load(open(self.classifier_object_path, 'rb'))
ModuleNotFoundError: No module named 'sklearn.ensemble._forest'
```
I used `conda list` to check for scikit-learn (assuming that's where sklearn.ensemble_forest should be coming from), and it wasn't there, so I installed it using conda, (it's listed now when `conda list` is run) but I am still getting the same error.  
Thanks very much for your help!

A. Murat Eren

unread,
Jan 11, 2021, 12:05:58 PM1/11/21
to Anvi'o
Can you please try to uninstall the conda-installed version and run this one in your environment?

pip install scikit-learn==0.23.2

Best,
--

A. Murat Eren (Meren) | he/him
http://merenlab.org :: twitter


--
Anvi'o Paper: https://peerj.com/articles/1319/
Project Page: http://merenlab.org/projects/anvio/
Code Repository: https://github.com/meren/anvio
---
You received this message because you are subscribed to the Google Groups "Anvi'o" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anvio+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/anvio/2b2fb172-652f-4e8f-ac84-818c8c0d1bfan%40googlegroups.com.

jonatho...@icloud.com

unread,
Jan 11, 2021, 7:35:18 PM1/11/21
to Anvi'o
That seemed to take care of it!  Thanks Meren!
Reply all
Reply to author
Forward
0 new messages