razhangwei / CAUSE

29 stars 10 forks source link

ModuleNotFoundError: No module named 'sklearn.externals.joblib #2

Open satcos opened 3 years ago

satcos commented 3 years ago

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'

razhangwei commented 3 years ago

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?

satcos commented 3 years ago

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