2

User program failed with ImportError: cannot import name '_joblib_parallel_args' from 'sklearn.utils.fixes' (/azureml-envs/azureml_39c082289e18c74c5b8523a75d2c0d1e/lib/python3.8/site-packages/sklearn/utils/fixes.py)

Anyone know why? Is there a workaround or a fix?

Stayne
  • 21
  • 5

3 Answers3

3

Try

pip uninstall scikit-learn

pip install scikit-learn==1.0.2

Mateusz
  • 41
  • 3
1

The error shows that we are not able to import the '_joblib_parallel_args' from 'sklearn.utils.fixes'

To fix this issue follow below ways:

  1. Uninstall and install the latest version of scikit-learn
#uninstall sklearn
pip uninstall sklearn

#uninstall scikit-learn
pip uninstall scikit-learn

#install sklearn
pip install sklearn
  1. Update scikit-learn into latest version
# update the scikit-learn & sklearn
pip install --upgrade scikit-learn
  1. You can directly import the joblib don't want to get from 'sklearn.utils.fixes.

Instead of importing below format

from sklearn.utils.fixes import joblib

You can use

import joblib

Reference

Delliganesh Sevanesan
  • 4,146
  • 1
  • 5
  • 15
  • 1
    The first two approaches didn't really work. For the third one, joblib isn't really imported anywhere For example it looks like this File "/azureml-envs/azureml_5d64f04af177d0972b95fc1fe9e57c99/lib/python3.8/site-packages/imblearn/ensemble/__init__.py", line 8, in from ._forest import BalancedRandomForestClassifier File "/azureml-envs/azureml_5d64f04af177d0972b95fc1fe9e57c99/lib/python3.8/site-packages/imblearn/ensemble/_forest.py", line 28, in from sklearn.utils.fixes import _joblib_parallel_args – Stayne May 16 '22 at 10:19
  • can you share the code for line 8 which thrown the error? – Delliganesh Sevanesan May 16 '22 at 10:26
0

Try this:

base ❯ pip install joblib
Requirement already satisfied: joblib in /opt/anaconda3/lib/python3.8/site-packages (1.0.1)

base ❯ pip install --target=/opt/anaconda3/lib/python3.8/site-package joblib
.......
Successfully installed joblib-1.1.0
RiveN
  • 2,595
  • 11
  • 13
  • 26
SGStand
  • 1
  • 3