@st.cache problems

I need the @st.cache decorator for a class but when i run the app it shows me this error message:

Streamlit cannot hash an object of type <class ’ main .classname’>

My project and venv live in two differents folders.
I tried the options suggested in the yellow box but they didn’t work.

Hi @checkthebias, thanks for your question.

This is just a guess – I can’t tell for sure without your code – but it looks like you’re trying to cache a procedure that doesn’t have a return value. Make sure you check the Streamlit docs for an explanation of what st.cache does and what its limitations are.

Try placing the @st.cache decorator around a smaller section of code, preferably a small deterministic function, so that you can see it working somewhere.

Thanks for trying out Streamlit! If you can share your streamlit code, we should be able to give you better advice.