I am having this issue in imports in Visual Studio and azure

Viewed 1047

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?

3 Answers

Try

pip uninstall scikit-learn

pip install scikit-learn==1.0.2

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

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
Related