Skip to content

ModuleNotFoundError: No module named 'sklearn.svm.classes' #23

@Sung-hub

Description

@Sung-hub

I was trying to use EukRep and got an error message below:
$ EukRep -i LIB204280.asm.p_ctg.fasta -o Euk_contigs.fa
Traceback (most recent call last):
File "/home/sung.shin/.local/bin/EukRep", line 17, in
EukRep.main(args)
File "/home/sung.shin/.local/lib/python3.8/site-packages/EukRep/EukRep.py", line 37, in main
model = pickle.load(args.model)
ModuleNotFoundError: No module named 'sklearn.svm.classes'

I installed the scikit-learn version that was used to create the pickle as the solution showed:
$ python

from sklearn import svm
from sklearn import datasets
clf = svm.SVC()
X, y= datasets.load_iris(return_X_y=True)
clf.fit(X, y)
SVC()
import pickle
s = pickle.dumps(clf)
clf2 = pickle.loads(s)
clf2.predict(X[0:1])
array([0])
y[0]
0
from joblib import dump, load
dump(clf, 'filename.joblib')
['filename.joblib']
clf = load('filename.joblib')

However, I still got same error message when I tried again:

$ EukRep -i ~/LIB204280/LIB204280.asm.p_ctg.fasta -o ~/LIB204280/Euk_contigs.fa --prokarya ~/LIB204280/Prok_contigs.fa
Traceback (most recent call last):
File "/home/sung.shin/.local/bin/EukRep", line 17, in
EukRep.main(args)
File "/home/sung.shin/.local/lib/python3.8/site-packages/EukRep/EukRep.py", line 37, in main
model = pickle.load(args.model)
ModuleNotFoundError: No module named 'sklearn.svm.classes'

Could you give me some advice?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions