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

sklearn.ensemble._forest can't be found #1682

Open
TonyMane opened this issue Feb 24, 2021 · 6 comments
Open

sklearn.ensemble._forest can't be found #1682

TonyMane opened this issue Feb 24, 2021 · 6 comments

Comments

@TonyMane
Copy link

Short description of the problem

Getting the following: ModuleNotFoundError: No module named 'sklearn.ensemble._forest'.
I tried installing this with pip, which says it can find it. This error occurs when doing 'anvi-self-test', however, it also occurs while doing 'anvi-gen-genomes-storage'.

anvi'o version

(anvio-master) (anvio-master) -bash-4.2$ 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

anvi-self-test --version

System info

Please tell us which operating system you are using, and how did you install anvi'o.

Detailed description of the issue

:: Firing up the interactive interface ...

Traceback (most recent call last):
File "/home/abertagnolli3/github/anvio/bin/anvi-interactive", line 122, in
d = interactive.Interactive(args)
File "/home/abertagnolli3/github/anvio/anvio/interactive.py", line 198, in init
self.completeness = Completeness(self.contigs_db_path)
File "/home/abertagnolli3/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 "/home/abertagnolli3/github/anvio/anvio/scgdomainclassifier.py", line 234, in init
SCGDomainClassifier.init(self, args, run, progress)
File "/home/abertagnolli3/github/anvio/anvio/scgdomainclassifier.py", line 73, in init
self.rf.initialize_classifier()
File "/home/abertagnolli3/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'

Config Error: According to the exit code ('1'), anvi'o suspects that something may have gone
wrong while running your tests :/ We hope that the reason is clear to you from
the lines above. But if you don't see anything obvious, and especially if the
test ended up running until the end with reasonable looking final results, you
shouldn't worry too much about this error. Life is short and we all can worry
just a bit less.

Files to reproduce

If you have no files you can share with us to reproduce the issue, please remove this text and header completely.

If you have files (i.e., a contigs database, a profile database, a BAM file, etc), please put them in a single directory, compress the directory, upload it to Dropbox and share with us a download link here along with instructions on how to reproduce the error.

@TonyMane TonyMane changed the title [BUG] Replace this text with a short but descriptive title sklearn.ensemble._forest can't be found Feb 24, 2021
@dhwanidesai
Copy link

Hello,
I have the exact same error as above, related to a missing "sklearn.ensemble_forest" module, while trying to run anvi-interactive:

(anvio-master) dhwani@vulcan:~/work/TolmanGEOVIDE-MetaG/genome_recruitment$ anvi-interactive -p BB40_final_assembly_recut-MERGED/PROFILE.db -c BB40_final_assembly_recut-CONTIGS.db --server
-only -P 8082
Traceback (most recent call last):
File "/home/dhwani/MyGit/anvio/bin/anvi-interactive", line 122, in
d = interactive.Interactive(args)
File "/home/dhwani/MyGit/anvio/anvio/interactive.py", line 198, in init
self.completeness = Completeness(self.contigs_db_path)
File "/home/dhwani/MyGit/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 "/home/dhwani/MyGit/anvio/anvio/scgdomainclassifier.py", line 234, in init
SCGDomainClassifier.init(self, args, run, progress)
File "/home/dhwani/MyGit/anvio/anvio/scgdomainclassifier.py", line 73, in init
self.rf.initialize_classifier()
File "/home/dhwani/MyGit/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'

Here is my Anvio version details:
(anvio-master) dhwani@vulcan:~/work/TolmanGEOVIDE-MetaG/genome_recruitment$ 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

Is there any fix for this? Desai

Thanks and regards,

Dhwani

@meren
Copy link
Member

meren commented Mar 1, 2021

Dear @TonyMane and @dhwanidesai,

I am not sure why you're getting this error, but this should solve it:

pip install scikit-learn==0.23.2

Please let me know how it goes if you try it.

@alienzj
Copy link

alienzj commented May 26, 2021

Dear @TonyMane and @dhwanidesai,

I am not sure why you're getting this error, but this should solve it:

pip install scikit-learn==0.23.2

Please let me know how it goes if you try it.

I ran into the same problem with Anvio 7. After doing it your way, the problem was solved.
Thanks very much~

* Anvi'o's self-test is done, and the temporary files are all gone.

@moritzbuck
Copy link
Contributor

or if on conda conda install --force --no-deps -c conda-forge - scikit-learn=0.24.2
the meta.yaml of the conda env has the wrong requirement
made a pull request: #1682

@moritzbuck
Copy link
Contributor

missing the bioconda, and used mamba not conda ... mamba install --force --no-deps -c conda-forge -c bioconda scikit-learn=0.24.2
well, basically force install the 0.24.2 scikit-learn version but for conda

@alexhbnr
Copy link

I can confirm that installing manually scikit-learn=0.24.2 solves the problem. Thanks @moritzbuck.

However, to work out of the box for installing anvio from bioconda, the recipe of anvio-minimal (https://github.com/bioconda/bioconda-recipes/blob/9f27b72aad38aef18ce4adecd63f3150a31b3b0c/recipes/anvio-minimal/meta.yaml#L28) would need to be adjusted accordingly to reflect to the change in the version because otherwise the error persists when directly installing anvio from bioconda using conda install anvio.

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

6 participants