'Error with from pycaret.classification import *

When I tried to run

from pycaret.classification import * 

I received this error:

ImportError
Traceback (most recent call last)
   <ipython-input-83-a8cb12878b37> in <module>()
    ----> 1 from pycaret.classification import *

    8 frames
    /usr/local/lib/python3.7/dist-packages/sklearn/metrics/pairwise.py in <module>()
         30 from ..utils._mask import _get_mask
         31 from ..utils.validation import _deprecate_positional_args
    ---> 32 from ..utils.fixes import sp_version, parse_version
         33 
         34 from ._pairwise_fast import _chi2_kernel_fast, _sparse_manhattan

    ImportError: cannot import name 'parse_version' from 'sklearn.utils.fixes' 
    (/usr/local/lib/python3.7/dist-packages/sklearn/utils/fixes.py)


Solution 1:[1]

I uninstalled Python and re-installed it and now it works but I don't know why

Solution 2:[2]

Please try:

import pycaret.classification

Let me know if this works

Solution 3:[3]

A possible resolution is to create a fresh environment. Sometimes conflicting packages cause issues so working with a fresh environment can help you determine whether this is the issue.

Let me know if this helps.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Bob Hoyt
Solution 2 gtomer
Solution 3 TeflonMusk