Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report #1519

Open
3 tasks done
sai-charan1 opened this issue Dec 15, 2023 · 0 comments
Open
3 tasks done

Bug Report #1519

sai-charan1 opened this issue Dec 15, 2023 · 0 comments

Comments

@sai-charan1
Copy link

sai-charan1 commented Dec 15, 2023

Current Behaviour

--------------------------------------------------------------------------- PydanticImportError Traceback (most recent call last) Cell In[8], line 1 ----> 1 from pandas_profiling import ProfileReport 2 prof = ProfileReport(df) 3 prof.to_file(output_file='output.html') File c:\Program Files\Python38\lib\site-packages\pandas_profiling\__init__.py:8 1 """Main module of pandas-profiling. 2 3 .. include:: ../../README.md 4 """ 6 from warnings import warn ----> 8 from pandas_profiling.compare_reports import compare 9 from pandas_profiling.controller import pandas_decorator 10 from pandas_profiling.profile_report import ProfileReport File c:\Program Files\Python38\lib\site-packages\pandas_profiling\compare_reports.py:6 2 from typing import Any, List, Optional, Tuple, Union 4 import pandas as pd ----> 6 from pandas_profiling.config import Correlation, Settings 7 from pandas_profiling.model.alerts import Alert 8 from pandas_profiling.profile_report import ProfileReport File c:\Program Files\Python38\lib\site-packages\pandas_profiling\config.py:7 4 from typing import Any, Dict, List, Optional, Tuple, Union 6 import yaml ----> 7 from pydantic import BaseModel, BaseSettings, Field, PrivateAttr 10 def _merge_dictionaries(dict1: dict, dict2: dict) -> dict: 11 """ 12 Recursive merge dictionaries. 13 (...) 16 :return: Merged dictionary 17 """ File c:\Program Files\Python38\lib\site-packages\pydantic\__init__.py:363, in __getattr__(attr_name) 361 dynamic_attr = _dynamic_imports.get(attr_name) 362 if dynamic_attr is None: --> 363 return _getattr_migration(attr_name) 365 package, module_name = dynamic_attr 367 from importlib import import_module File c:\Program Files\Python38\lib\site-packages\pydantic\_migration.py:296, in getattr_migration.<locals>.wrapper(name) 294 return import_string(REDIRECT_TO_V1[import_path]) 295 if import_path == 'pydantic:BaseSettings': --> 296 raise PydanticImportError( 297 '`BaseSettings` has been moved to the `pydantic-settings` package. ' 298 f'See https://docs.pydantic.dev/{version_short()}/migration/#basesettings-has-moved-to-pydantic-settings ' 299 'for more details.' 300 ) 301 if import_path in REMOVED_IN_V2: 302 raise PydanticImportError(f'`{import_path}` has been removed in V2.') PydanticImportError: `BaseSettings` has been moved to the `pydantic-settings` package. See https://docs.pydantic.dev/2.5/migration/#basesettings-has-moved-to-pydantic-settings for more details. For further information visit https://errors.pydantic.dev/2.5/u/import-error
  | PassengerId | Survived | Pclass | Name | Sex | Age | SibSp | Parch | Ticket | Fare | Cabin | Embarked -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- 1 | 0 | 3 | Braund, Mr. Owen Harris | male | 22.0 | 1 | 0 | A/5 21171 | 7.2500 | NaN | S 2 | 1 | 1 | Cumings, Mrs. John Bradley (Florence Briggs Th... | female | 38.0 | 1 | 0 | PC 17599 | 71.2833 | C85 | C 3 | 1 | 3 | Heikkinen, Miss. Laina | female | 26.0 | 0 | 0 | STON/O2. 3101282 | 7.9250 | NaN | S 4 | 1 | 1 | Futrelle, Mrs. Jacques Heath (Lily May Peel) | female | 35.0 | 1 | 0 | 113803 | 53.1000 | C123 | S 5 | 0 | 3 | Allen, Mr. William Henry | male | 35.0 | 0 | 0 | 373450 | 8.0500 | NaN | S
--------------------------------------------------------------------------- PydanticImportError Traceback (most recent call last) Cell In[8], [line 1](vscode-notebook-cell:?execution_count=8&line=1) ----> [1](vscode-notebook-cell:?execution_count=8&line=1) from pandas_profiling import ProfileReport [2](vscode-notebook-cell:?execution_count=8&line=2) prof = ProfileReport(df) [3](vscode-notebook-cell:?execution_count=8&line=3) prof.to_file(output_file='output.html')

File c:\Program Files\Python38\lib\site-packages\pandas_profiling_init_.py:8
1 """Main module of pandas-profiling.
2
3 .. include:: ../../README.md
4 """
6 from warnings import warn
----> 8 from pandas_profiling.compare_reports import compare
9 from pandas_profiling.controller import pandas_decorator
10 from pandas_profiling.profile_report import ProfileReport

File c:\Program Files\Python38\lib\site-packages\pandas_profiling\compare_reports.py:6
2 from typing import Any, List, Optional, Tuple, Union
4 import pandas as pd
----> 6 from pandas_profiling.config import Correlation, Settings
7 from pandas_profiling.model.alerts import Alert
8 from pandas_profiling.profile_report import ProfileReport

File c:\Program Files\Python38\lib\site-packages\pandas_profiling\config.py:7
4 from typing import Any, Dict, List, Optional, Tuple, Union
6 import yaml
----> 7 from pydantic import BaseModel, BaseSettings, Field, PrivateAttr
10 def _merge_dictionaries(dict1: dict, dict2: dict) -> dict:
11 """
12 Recursive merge dictionaries.
13
(...)
16 :return: Merged dictionary
17 """

File c:\Program Files\Python38\lib\site-packages\pydantic_init_.py:363, in getattr(attr_name)
361 dynamic_attr = _dynamic_imports.get(attr_name)
362 if dynamic_attr is None:
--> 363 return _getattr_migration(attr_name)
365 package, module_name = dynamic_attr
367 from importlib import import_module

File c:\Program Files\Python38\lib\site-packages\pydantic_migration.py:296, in getattr_migration..wrapper(name)
294 return import_string(REDIRECT_TO_V1[import_path])
295 if import_path == 'pydantic:BaseSettings':
--> 296 raise PydanticImportError(
297 'BaseSettings has been moved to the pydantic-settings package. '
298 f'See https://docs.pydantic.dev/{version_short()}/migration/#basesettings-has-moved-to-pydantic-settings '
299 'for more details.'
300 )
301 if import_path in REMOVED_IN_V2:
302 raise PydanticImportError(f'{import_path} has been removed in V2.')

PydanticImportError: BaseSettings has been moved to the pydantic-settings package. See https://docs.pydantic.dev/2.5/migration/#basesettings-has-moved-to-pydantic-settings for more details.

For further information visit https://errors.pydantic.dev/2.5/u/import-error
PassengerId Survived Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked
0 1 0 3 Braund, Mr. Owen Harris male 22.0 1 0 A/5 21171 7.2500 NaN S
1 2 1 1 Cumings, Mrs. John Bradley (Florence Briggs Th... female 38.0 1 0 PC 17599 71.2833 C85 C
2 3 1 3 Heikkinen, Miss. Laina female 26.0 0 0 STON/O2. 3101282 7.9250 NaN S
3 4 1 1 Futrelle, Mrs. Jacques Heath (Lily May Peel) female 35.0 1 0 113803 53.1000 C123 S
4 5 0 3 Allen, Mr. William Henry male 35.0 0 0 373450 8.0500 NaN S

Expected Behaviour

Should run without any issues

Data Description

It is the training dataset
train.json

Code that reproduces the bug

from pandas_profiling import ProfileReport
prof = ProfileReport(df)
prof.to_file(output_file='output.html')

pandas-profiling version

v3.6.6

Dependencies

numpy==1.24.4
pandas==2.0.3

OS

Windows 11

Checklist

  • There is not yet another bug report for this issue in the issue tracker
  • The problem is reproducible from this bug report. This guide can help to craft a minimal bug report.
  • The issue has not been resolved by the entries listed under Common Issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants