Streamlit not recognizing module

Hello, I am trying to unpickle an object in streamlit but am having some trouble. My first thought is that because this module is cython compiled that streamlit may be having some trouble.

Unpickling in Ipython works fine:

file = open(r'/media/H/Python/Nevados/hdmodeler/sites/site.ut-01/site_files/site.pkl', 'rb')
site = pickle.load(file)

But the same exact code called from streamlit gives the following error:

Thank you for your help!

I also cannot pickle said object which makes confirms my cython suspicions

Hi @kurt-rhee :wave:

This doesn’t look like a Streamlit issue. If you removed all the Streamlit st. calls, and executed it as a pure Python script, you would likely run into the same errors.

If you pickled an object that used a certain dependency, that dependency should be installed and imported when unpickling. In this case, you probably need to install vec and import it in your scripts.

Best, :balloon:

Hello @snehankekre

This is untrue. In my original post I wrote “Unpickling in Ipython works fine” Removing all st calls works without errors when running from pycharm.

I have created a bug report here:

1 Like