Altair plots showing up as blank webpage

Ask the community or our support engineers for answers to questions.
Hello All,
I am new to streamlit and today while working on a Altair dashboard, I tried to plot some basic Altair charts first using my terminal prompt and then within jupyter notebook to test it out. However, both instances resulted in a blank output.

The code I used, was from the Altair visualization library.

import altair as alt
import pandas as pd

def source():

  df = pd.DataFrame({'a': ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'],
                         'b': [28, 55, 43, 91, 81, 53, 19, 87, 52]})
  plot = (alt.Chart(df)
  return plot 

if __ name __ == ‘__ main __’:


Terminal: streamlit run
Output : Blank webpage

Jupyter : st.altair(source(), use_container_width=False)
Output: DeltaGenerator(_root_container=0, _provided_cursor=None, _parent=None, _block_type=None, _form_data=None)

Python 3.9.7
Streamlit 1.9.0

I am not sure what might be causing this and will appreciate some help. Thanks!