Streamlit 30 day challenge issue with pandas_profiling

Summary

I am doing the streamlit 30 days challenge course.
When importing pandas_profiling I get an error that is not solved by updating pandas and pandas_profiling.

Steps to reproduce

Code snippet:

import pandas as pd

import numpy as np
import streamlit as st
import altair as alt
from datetime import time, datetime
from vega_datasets import data as vega_data
import pandas_profiling



If applicable, please provide the steps we should take to reproduce the error or specified behavior.

simple import

Explain what you expect to happen when you run the code above.

ImportError: cannot import name ‘to_html’ from ‘pandas_profiling.report’ (C:\Users\Hans\anaconda3\envs\streamlit-env\lib\site-packages\pandas_profiling\report_init_.py)

Explain the undesired behavior or error you see when you run the code above.
If you’re seeing an error message, share the full contents of the error message here.

Debug info

  • Streamlit version: (get it with $ streamlit version)
  • Python version: (get it with $ python --version)
  • Using Conda? PipEnv? PyEnv? Pex?
  • OS version:
  • Browser version:

Requirements file

Using Conda? PipEnv? PyEnv? Pex? Share the contents of your requirements file here.
Not sure what a requirements file is? Check out this doc and add a requirements file to your app.

Links

  • Link to your GitHub repo:
  • Link to your deployed app:

Additional information

If needed, add any other context about the problem here.

1 Like

I am using latest streamlit version, python 3.10 and using conda

I did conda install -c conda-forge pandas-profiling
for updates I did conda update pandas

Ok,

So I think I solved the issue for myself. Apparently, I read on Pypi that the package pandas-profiling is changed to the name and update: “data-profiling”…After installing this package and then importing ydata_profiling in the script instead of pandas-profiling all works fine, and no more errors.

The Streamlit devs might want to update this for their 30-day course challenge on day 14:streamlit components ==> pandas-profiling is now ydata-profiling

cheers
H

Hi @hans

Thanks for pointing this out. Day 14 has been updated to ydata_profiling from pandas_profiling.

For a full working example please see the following repo:

The demo app is here:

https://ydata-profiling.streamlit.app/

Best regards,
Chanin

1 Like

Check this app, i have developed using ydata_profiling

Demo App: https://ydataprofiling.streamlit.app/

Git Hub repo : GitHub - Jagadeesha89/y_data_profiling

1 Like

My pleasure!

Hi,
I’m getting this error on Day 14:

Python 3.10.13 (maybe 14 now?), venv, Thonny, SolusOS

Hi @mike_finko

Would installing pydantic-settings resolve the error

pip install pydantic-settings

No, same error message. At first, I thought it might be my fault because I did not

pip install streamlit_pandas_profiling

via the terminal but though my IDE, Thonny, using their package manager.
So I ‘stopped/deactivated/cd’d back to main’ and installed via the terminal, no change, same error message.
Next I tried

pip install pydantic-settings

both through the package manager and terminal, no change.
Next I exited everything, turned off my laptop, turned back on, used BleachBit to clean, tried again, no change, same message.
One last thing I tried - there was a message in the terminal to upgrade pypi (?) so upgraded and tested again, no change, same message.

venv
Streamlit version 1.26.0
Firefox 119.0
Python 3.10.13
Solus OS 4.4 / Budgie 10.8.2

Hi @mike_finko

Can you try using the following repo and see if it works:

As also mentioned in an earlier post, the demo app of this is at

Please note that it is now ydata_profiling

Hope this helps!