talon
talon copied to clipboard
Joblib error
Hi, when trying the machine learning approach to extract the text and signature from the email that is in the readme i get this error
ImportError: cannot import name 'joblib' from 'sklearn.externals' (/home/christmas/Projects/emails/emails/lib/python3.7/site-packages/sklearn/externals/__init__.py)
I'm on debian buster, using venv/pipenv and getting that result Can anybody help me fix this? thanks
is this library deprecated?
I am also getting a similar error
I solved this issue by uninstalling scikit-learn and reinstalling a lower version. To remove the current version, you can run pip uninstall scikit-learn
Then, to re install v 0.22.2 run pip install scikit-learn==0.22.2
thx @mann2107 i took another approach and removed the machine learning logic, at the end i just needed the regex pack, but ill try this
@atanasoff-yordan I faced exactly the same issue and submitted pull request: https://github.com/mailgun/talon/pull/219
I have the same issue, adding scikit-learn==0.22.2 to requirements.txt didn't help me. Is there any info when new release wit PR can be published?
I solved this issue by uninstalling scikit-learn and reinstalling a lower version. To remove the current version, you can run pip uninstall scikit-learn
Then, to re install v 0.22.2 run pip install scikit-learn==0.22.2
Thanks It worked...
This is the original warning which sckit-learn is throwing in 0.22.2 version:
FutureWarning: sklearn.externals.joblib is deprecated in 0.21 and will be removed in 0.23. Please import this functionality directly from joblib, which can be installed with: pip install joblib. If this warning is raised when loading pickled models, you may need to re-serialize those models with scikit-learn 0.21+.
I think this may be a problem with the pypi version of talon.
If you look here on the repo in classifier.py, you see the includes are
from numpy import genfromtxt
import joblib
from sklearn.svm import LinearSVC
But if you do a fresh install of talon pip install --force-reinstall talon
and look at the classifier.py in the lib, you'll see that the imports are:
from numpy import genfromtxt
from sklearn.externals import joblib
from sklearn.svm import LinearSVC
can confirm
pip install git+https://github.com/mailgun/talon/
fixes
ImportError: cannot import name 'joblib' from 'sklearn.externals'