1

I'm trying to use pyCaret on Colab. This is the setup:

!pip install pycaret
from pycaret.classification import *
grid = setup(data=s, target=s.columns[-1], html=False, silent=True, verbose=False)
best_model = compare_models()

However, I get this error on from pycaret.classification import *:

ImportError: Missing optional dependency 'Jinja2'. DataFrame.style requires jinja2. Use pip or conda to install Jinja2.

I've already followed this instruction unsuccessfully. Unable to resolve import error from PyCaret

Any clue?

Nimantha
  • 6,405
  • 6
  • 28
  • 69
GoT GOt
  • 49
  • 1
  • 9

2 Answers2

1

If anyone else facing this issue and if its not work like author said try ;

pip install pycaret --user

after execution of code chunk done click *restart runtime button. after install if its succesfully import libraries skip markupsafe phase.

pip install markupsafe==2.0.1

after execution of code chunk done click *restart runtime button.

import jinja2
from pycaret.classification import *
elandil2
  • 25
  • 1
  • 3
0

You can also just install Jinja2 manually to solve this problem:

https://github.com/pycaret/pycaret/issues/2490

Nikhil Gupta
  • 1,436
  • 12
  • 15