11

I'm trying to install pycaret==3.0.0 in google colab, But I'm having a problem, the library requires Jinja2 to be installed which I did, but then It finally throws off another error.

ImportError                               Traceback (most recent call last)
<ipython-input-26-4f8843d24b3a> in <module>()
----> 1 import jinja2
      2 from pycaret.regression import *

3 frames
/usr/local/lib/python3.7/dist-packages/jinja2/filters.py in <module>()
     11 from markupsafe import escape
     12 from markupsafe import Markup
---> 13 from markupsafe import soft_unicode
     14 
     15 from ._compat import abc

ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/root/.local/lib/python3.7/site-packages/markupsafe/__init__.py)
Talha Tayyab
  • 8,111
  • 25
  • 27
  • 44
Kalu Samuel
  • 145
  • 1
  • 1
  • 5

4 Answers4

20

This is caused by upgrade in MarkupSafe:2.1.0 where they have removed soft_unicode, try using:

pip install markupsafe==2.0.1
Andres S
  • 1,168
  • 7
  • 11
0

Can you try this. This will install the latest release of pycaret and should take care of all dependencies for you. Just remember to restart the kernel after installation for the install to take effect correctly.

pip install -U --pre pycaret
Nikhil Gupta
  • 1,436
  • 12
  • 15
  • Hi could you answer this if you happen to know https://stackoverflow.com/questions/73362136/unboundlocalerror-local-variable-fix-imbalance-model-name-referenced-before-a – Scope Aug 15 '22 at 15:26
0

I did the following to solve the same issue:

pip install -U markupsafe

so that I can use the latest version. I also had to update jinja2 with the same type of command.

-1

Try this:

pip install markupsafe==2.1.1
conda update jupyter
Roj
  • 995
  • 1
  • 8
  • 22