1

I'm stuck on an issue that I can't seem to solve. I was fine using PyCaret on my other PC and had recently got a new desktop.

I was working on one dataset on my old PC and had no problems with setup() and PyCaret preprocessed my data without any issues. When I worked on my the same dataset with my new desktop and Jupyter newly installed, I noticed I ran into an ValueError: Setting a random_state has no effect since shuffle is False. You should leave random_state to its default (None), or set shuffle=True. I thought it was strange but went on to set fold_shuffle=True to get through this.

Next, I encountered AttributeError: 'Simple_Imputer' object has no attribute 'fill_value_categorical'. It seems I'm getting failures at every step of setup(). I went through the forums and found a thread where at the bottom of it, @eddygeek mentioned that PyCaret was set up to fail if the sklearn version is wrong. This got me looking into the packages I have that may meet dependencies between packages.

I noticed the following issues:

  1. I get several errors: ERROR: Command errored out with exit status 1: C:\Users\%%USER%%\anaconda3\python.exe' Ignoring numpy: markers 'python_version >= "3.8" and platform_system == "AIX"' don't match your environment ERROR: Could not find a version that satisfies the requirement scikit-learn==0.23.2 Screenshot of more errors attached

  2. Jupyter Notebook fails to launch because of Pandas Profiling Import Error: cannot import name 'soft_unicode' from 'markupsafe'. I got around this by installing markupsafe===2.0.1 but this leads to incompatibility warning by pandas-profiling 3.2.0 saying it needs markupsafe 2.1.1

  3. PyCaret keeps getting installed as 2.2.2 version. I think that's why it keeps looking for scikit-learn 0.23.2 when the latest PyCaret 2.3.10 works with scikit-learn >=1.0. I've tried uninstalling and reinstalling PyCaret several times but it's still the same.

What I've done

I'm on Python 3.9.12 that was installed together with Anaconda3. My PyCaret was installed with pip install pycaret[full] --user on Anaconda Prompt.

In my pip list, I have:

  • scikit-learn 1.1.2
  • markupsafe 2.1.1
  • pandas-profiling 3.2.0
  • pycaret 2.2.2

I've added C:\Users\%%USER%%\AppData\Roaming\Python\Python39\Scripts to PATH

I'm really at my wits end so I hope I can get some advice on this. Thank you.

aoryx
  • 11
  • 2

2 Answers2

0

I've encountered the very same issues and solved as follows.

According to the documentation, there are a few problems with your setup:

  1. PyCaret is not yet compatible with sklearn>=0.23.2

  2. PyCaret is tested and supported on the following 64-bit systems:

    Python 3.6 – 3.8 Python 3.9 for Ubuntu only

So if you're using python 3.9 on Windows, I'd start with that.

I went into a rabbit hole of downgrading the packages and getting one error after another.

Long story short, the setup that finally worked was:

sklearn 0.23.1
scipy 1.5.2

Both installed on a virtual conda environment but at the end I had to run:

pip3 install pycaret[full]

Notice pip3 intead of pip because I was getting permission errors.

MarcinKamil
  • 135
  • 8
0

You are using a very old version of pycaret which does not work in Python 3.9. Please install the latest version in a fresh (conda) environment. Make sure it is a new environment in order to avoid any package issues.

# This installs the pre-release 3.0.0 release which has reduced dependencies.
pip install --pre pycaret
Nikhil Gupta
  • 1,436
  • 12
  • 15
  • It wasn't my choice to install it as 2.2.2. If you see my Point 3, it keeps getting installed as 2.2.2 even though I've tried pip install pycaret [full]. But I'll try out 3.0.0 – aoryx Nov 13 '22 at 15:15