1

i have installed pycaret in virtual env in jupyter, using pip3 install pycaret.

but when am trying to import it as

from pycaret.regression import*

or

from pycaret import classification

am getting this errors

OSError: dlopen(/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/lightgbm/lib_lightgbm.so, 6): Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/lightgbm/lib_lightgbm.so
  Reason: image not found

i have reinstalled the 'lightgbm' incase you think this may cause the error, but this to didn't worked.

as i am stuck in my project any help will be appreciated.

Abhishek
  • 45
  • 8

1 Answers1

1

I've had precisely the same error as you for a while now on several projects (macOS). I don't know what this error is either. I do not guarantee to have the best solution, but I can show you the workaround I found to get Pycaret working.

To begin with, I created a Conda environment with Python 3.9, activated it and installed Pycaret with pip.

create --name your-env-name python=3.9 
conda activate your-env-name
pip install pycaret

At this point, we have the same problem, so I first start by forcing the reinstallation of lightgbm with Conda.

conda install lightgbm --force-reinstall

Now I have the following new error message :

ImportError: Numba needs NumPy 1.21 or less

Therefore, I did :

pip install numba==0.53 --force-reinstall

Last but not least Pycaret is working and you will likely have the following error :

AttributeError: 'Simple_Imputer' object has no attribute 'fill_value_categorical'

I solved that by doing :

pip install scikit-learn==0.23.2 --force-reinstall

And voilĂ ! Now it is possible to get the job done (at least on my side and I hope also on yours).

jlcC84g
  • 86
  • 5