Olá. Estou há alguns dias tentando solucionar esse erro, mas sem sucesso.
Estou tentando importar o ProfileReport da biblioteca pandas_profiling. Consigo fazer a instalação via pip, direto do repositório no GitHub. Usando
#Baixando Pandas-profile
!pip install https://github.com/ydataai/pandas-profiling/archive/master.zip
Em seguida, quando tento realizar importação do ProfileReport
#Importanto ProfileReport
from pandas_profiling import ProfileReport
Esse erro é apresentado:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
/tmp/ipykernel_62935/1977696158.py in <module>
1 #Importanto ProfileReport
2
----> 3 from pandas_profiling import ProfileReport
~/anaconda3/lib/python3.9/site-packages/pandas_profiling/__init__.py in <module>
4 """
5
----> 6 from pandas_profiling.controller import pandas_decorator
7 from pandas_profiling.profile_report import ProfileReport
8 from pandas_profiling.version import __version__
~/anaconda3/lib/python3.9/site-packages/pandas_profiling/controller/pandas_decorator.py in <module>
2 from pandas import DataFrame
3
----> 4 from pandas_profiling.profile_report import ProfileReport
5
6
~/anaconda3/lib/python3.9/site-packages/pandas_profiling/profile_report.py in <module>
25 from pandas_profiling.report.presentation.core import Root
26 from pandas_profiling.report.presentation.core.renderable import Renderable
---> 27 from pandas_profiling.report.presentation.flavours.html.templates import (
28 create_html_assets,
29 )
~/anaconda3/lib/python3.9/site-packages/pandas_profiling/report/presentation/flavours/html/__init__.py in <module>
----> 1 from pandas_profiling.report.presentation.flavours.html.alerts import HTMLAlerts
2 from pandas_profiling.report.presentation.flavours.html.collapse import HTMLCollapse
3 from pandas_profiling.report.presentation.flavours.html.container import HTMLContainer
4 from pandas_profiling.report.presentation.flavours.html.duplicate import HTMLDuplicate
5 from pandas_profiling.report.presentation.flavours.html.frequency_table import (
~/anaconda3/lib/python3.9/site-packages/pandas_profiling/report/presentation/flavours/html/alerts.py in <module>
1 from pandas_profiling.report.presentation.core.alerts import Alerts
----> 2 from pandas_profiling.report.presentation.flavours.html import templates
3
4
5 class HTMLAlerts(Alerts):
~/anaconda3/lib/python3.9/site-packages/pandas_profiling/report/presentation/flavours/html/templates.py in <module>
3 from pathlib import Path
4
----> 5 import jinja2
6
7 from pandas_profiling.config import Settings, Theme
~/anaconda3/lib/python3.9/site-packages/jinja2/__init__.py in <module>
10 from .bccache import FileSystemBytecodeCache
11 from .bccache import MemcachedBytecodeCache
---> 12 from .environment import Environment
13 from .environment import Template
14 from .exceptions import TemplateAssertionError
~/anaconda3/lib/python3.9/site-packages/jinja2/environment.py in <module>
23 from .compiler import CodeGenerator
24 from .compiler import generate
---> 25 from .defaults import BLOCK_END_STRING
26 from .defaults import BLOCK_START_STRING
27 from .defaults import COMMENT_END_STRING
~/anaconda3/lib/python3.9/site-packages/jinja2/defaults.py in <module>
1 # -*- coding: utf-8 -*-
2 from ._compat import range_type
----> 3 from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401
4 from .tests import TESTS as DEFAULT_TESTS # noqa: F401
5 from .utils import Cycler
~/anaconda3/lib/python3.9/site-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' (/home/victor/anaconda3/lib/python3.9/site-packages/markupsafe/__init__.py)