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.
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
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.