How to run Streamlit version 1.24

Options
Marlan
Marlan Neuron 2020, Neuron, Registered, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2021, Neuron 2022, Dataiku Frontrunner Awards 2021 Participant, Neuron 2023 Posts: 317 Neuron

Hi all,

Any suggestions on how to run Streamlit version 1.24.0 in a Code Studio? I'd like to use the chat_message and chat_input elements introduced in that version to build an LLM chat UI.

I am running the Dataiku hosted edition, version 12.1.0.

I've tried creating a separate code environment for use in the code studio template but wasn't able to create a code environment with Streamlit version 1.24 in it (when I specified that version, the environment failed with a Jupyter support installation failed error.

I was able to create a code environment with an older version of Streamlit and include it in a code studio template but then the Code Studio start up never finished.

Thanks for any suggestions.

Marlan

cc @info-rchitect
, @importthepandas
, @AlexT

Best Answer

  • Marlan
    Marlan Neuron 2020, Neuron, Registered, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2021, Neuron 2022, Dataiku Frontrunner Awards 2021 Participant, Neuron 2023 Posts: 317 Neuron
    edited July 17 Answer ✓
    Options

    OK, I figured out a solution - at least for the cloud version of Dataiku.

    Create streamlit code studio template as follows:

    Step 1: Add a Append to Dockerfile block. Specify the following statement in the dockerfile text box:

    RUN python3.9 -m venv /home/dataiku/streamlit-v125-env && (source /home/dataiku/streamlit-v125-env/bin/activate && pip install streamlit==1.25.0 "numpy==1.23.1" "urllib3<2" "altair==4.2.2")

    I worked this out by looking at docker files for other code studio templates; I've not used docker files before so could be I'm doing something really dumb - if so let me know please! - but it does work.

    Note that I added the numpy==1.23.1 because without this importing dataiku results in an invalid use of np.bool error.

    I didn't test whether it is necessary to put this block before the Streamlit. I'd guess it doesn't matter.

    Step 2: Add the Streamlit block

    Specify the following settings:

    Code env mode: Manually installed [advanced]

    Code env path: /home/dataiku/streamlit-v125-env

    Leave everything else at the default settings.

    The code environment path should match the path used in the Append to Dockerfile statement.

    Step 3: Add the Visual Studio code block with the default settings.

Answers

Setup Info
    Tags
      Help me…