0

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)
desertnaut
  • 57,590
  • 26
  • 140
  • 166
Bob Hoyt
  • 61
  • 4
  • 9

5 Answers5

1

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

Bob Hoyt
  • 61
  • 4
  • 9
1

Try running this code !pip install markupsafe==2.0.1. Let me know if this helps.

Samaritan
  • 11
  • 2
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 16 '22 at 07:45
0

Please try:

import pycaret.classification

Let me know if this works

gtomer
  • 5,643
  • 1
  • 10
  • 21
0

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.

TeflonMusk
  • 130
  • 8
0

I also ran into the same issue and found this solution helpful when working on google colab, although on Jupiter it didn't, so I created a virtual environment to work in, and it worked out smoothly.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 04 '22 at 00:36