Skip to content

Streamlit failed to hash an object #242

@robotastic

Description

@robotastic

I am trying to get the DataFrame Demo from streamlit hello to work. I am running this using Anaconda and Python 3.6.

I get the following error in the browser:

Streamlit cannot hash an object of type <class 'os._Environ'>.,

More information: to prevent unexpected behavior, Streamlit tries to detect mutations in cached objects so it can alert the user if needed. However, something went wrong while performing this check.

Please file a bug.

To stop this warning from showing in the meantime, try one of the following:

Preferred: modify your code to avoid using this type of object.
Or add the argument ignore_cache=True to the st.cache decorator.

I get a bunch of additional errors on Streamlit failed to hash an object of type <class 'function'>.,

And then this error blob:

TypeError: object supporting the buffer API required
File "/Users/lberndt/anaconda/envs/python3/lib/python3.6/site-packages/streamlit/ScriptRunner.py", line 306, in _run_script exec(code, module.__dict__)
File "/Users/lberndt/anaconda/envs/python3/lib/python3.6/site-packages/streamlit/hello.py", line 334, in <module> run()
File "/Users/lberndt/anaconda/envs/python3/lib/python3.6/site-packages/streamlit/hello.py", line 308, in run demo()
File "/Users/lberndt/anaconda/envs/python3/lib/python3.6/site-packages/streamlit/hello.py", line 247, in data_frame_demo df = get_UN_data()
File "/Users/lberndt/anaconda/envs/python3/lib/python3.6/site-packages/streamlit/caching.py", line 544, in wrapped_func return get_or_set_cache()
File "/Users/lberndt/anaconda/envs/python3/lib/python3.6/site-packages/streamlit/caching.py", line 509, in get_or_set_cache code_hasher.update(func)
File "/Users/lberndt/anaconda/envs/python3/lib/python3.6/site-packages/streamlit/hashing.py", line 185, in update self._update(self.hasher, obj, context)
File "/Users/lberndt/anaconda/envs/python3/lib/python3.6/site-packages/streamlit/hashing.py", line 217, in _update hasher.update(b)

Metadata

Metadata

Assignees

Labels

feature:cacheRelated to `st.cache_data` and `st.cache_resource`type:bugSomething isn't working as expected

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions