Pyplot not working

Hello,
I’m using the basic example to use pyplot, but it’s crashing. The code is:

# Import python packages
import streamlit as st
import matplotlib.pyplot as plt
import numpy as np

arr = np.random.normal(1, 1, size=100)
fig = plt.figure()
plt.hist(arr, bins=20)

# Write directly to the app
st.title(f"Test de Ricardo {fig}")
st.pyplot(fig)

And getting

AttributeError: 'NoneType' object has no attribute 'load_and_get_id'

Is it a limitation of Snowflake? Is there a solution?

The code works perfectly fine, also I don’t see any reference of snowflake in your code snippet.

Hello Navin, thanks for your reply. Are you running this in a snowflake streamlit app? I am not using yet snowflake specific libraries or functions like st.experimental_connection('snowpark'), because first I’m trying to just plot with matplotlib. But it is running in snowflake as a streamlit app.

If that’s in snowflake, what version of matplotlib and numpy did you add in the packages dropdown? It’s the only different thing I can think of.

My bad, this specific function is not yet supported:
https://docs.snowflake.com/en/developer-guide/streamlit/limitations#label-streamlit-unsupported-features

I hope it will be in the future!

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