CAUSE icon indicating copy to clipboard operation
CAUSE copied to clipboard

ModuleNotFoundError: No module named 'sklearn.externals.joblib

Open satcos opened this issue 4 years ago • 2 comments

Scripts throw "ModuleNotFoundError: No module named 'sklearn.externals.joblib'" error

Traceback (most recent call last): File "/Users/user1/MyGitRepo/CAUSE/tasks/train.py", line 269, in model = get_model(args, n_types) File "/Users/user1/MyGitRepo/CAUSE/tasks/train.py", line 61, in get_model from tick.hawkes import HawkesExpKern File "/Users/user1/opt/miniconda3/envs/Cause/lib/python3.7/site-packages/tick/hawkes/init.py", line 3, in from .model import ( File "/Users/user1/opt/miniconda3/envs/Cause/lib/python3.7/site-packages/tick/hawkes/model/init.py", line 4, in import tick.base_model.build.base_model File "/Users/user1/opt/miniconda3/envs/Cause/lib/python3.7/site-packages/tick/base_model/init.py", line 5, in from .model_labels_features import ModelLabelsFeatures File "/Users/user1/opt/miniconda3/envs/Cause/lib/python3.7/site-packages/tick/base_model/model_labels_features.py", line 6, in from tick.preprocessing.utils import safe_array File "/Users/user1/opt/miniconda3/envs/Cause/lib/python3.7/site-packages/tick/preprocessing/init.py", line 4, in from .longitudinal_features_product import LongitudinalFeaturesProduct File "/Users/user1/opt/miniconda3/envs/Cause/lib/python3.7/site-packages/tick/preprocessing/longitudinal_features_product.py", line 8, in from sklearn.externals.joblib import Parallel, delayed ModuleNotFoundError: No module named 'sklearn.externals.joblib'

satcos avatar Feb 24 '21 11:02 satcos

It should be an issue of tick, as the sklearn does not bundle joblib since recent versions. Can you try editing that ongitudinal_features_product.py file to from joblib import Parallel, delayed?

razhangwei avatar Feb 26 '21 03:02 razhangwei

In my local copy I edited the import function from tick library.

This issues is already reported and fixed in tick, waiting for release. https://github.com/X-DataInitiative/tick/issues/459

satcos avatar Mar 02 '21 05:03 satcos