Hiplot Error

Hiplot with Streamlit

Hi All
I am tring to use hiplot on my local streamlit program to show high dimension Data.
But as I followed the steps on hiplot website
hiplot offical document
I encounter this problem.

My Code is as followed"

import json
import streamlit as st
import hiplot as hip

x1, x2, x3 = st.slider('x1'), st.slider('x2'), st.slider('x3')

# Create your experiment as usual
data = [{'uid': 'a', 'dropout': 0.1, 'lr': 0.001, 'loss': 10.0, 'optimizer': 'SGD', 'x': x1},
        {'uid': 'b', 'dropout': 0.15, 'lr': 0.01, 'loss': 3.5, 'optimizer': 'Adam', 'x': x2},
        {'uid': 'c', 'dropout': 0.3, 'lr': 0.1, 'loss': 4.5, 'optimizer': 'Adam', 'x': x3}]
xp = hip.Experiment.from_iterable(data)

# Instead of calling directly `.display()`
# just convert it to a streamlit component with `.to_streamlit()` before
ret_val = xp.to_streamlit(ret="selected_uids", key="hip").display()

st.markdown("hiplot returned " + json.dumps(ret_val))

It will be great if someone have encountered and solved this problem!
Appreciate in front!

Debug info

  • Streamlit version: (version 1.22.0)
  • Python version: (Python 3.10.9)
  • hiplot version:(hiplot 0.1.33)
  • Browser version:

Thanks for the quick reply.
sorry but I am pretty new on the github issue thing,
chould you please show me what should I change in my code so I can avoid this error?

It depends on whether you want to run the streamlit app locally only or deploy it also to streamlit cloud.

I think there are these options, here in ascending difficulty:

  • Downgrade the Streamlit version to the version that still has this attribute. But I don’t know in which Streamlit version this change was made.
  • pip install the hiplot version from the pull request
  • Patch the local installation of the hiplot library
  • Monkey patching of hiplot within the application

I think this should be the easiest approach, but i haven’t tested it:

Unless the pull request is not merged into the main repository, you could try to install the patched hiplot version from the pull request:

pip install git+https://github.com/Gizzio/hiplot@main

Or if you want to deploy to streamlit cloud, add this:



Thanks a lot!! :pray: :pray: I will try this method later

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.