question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mapping and DataFrame demo apps through errors

See original GitHub issue

Summary

While going through the demos provided in hello app I have encountered problems with two out of four (Mapping and DataFrame demo apps) through errors.

Steps to reproduce

  1. mkvirtualenv streamllit
  2. pip install streamlit
  3. streamlit hello
  4. Click on Mapping Demo or DataFrame Demo

Expected behavior:

I would expect demos would be shown in the right pain. It works as expected for the first two apps (Animation and Plotting Demo).

Actual behavior:

I get notifications, first

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

and then 6 of these

Streamlit failed to hash an object of type <class 'function'>.,
...

and at the end there is a traceback:

TypeError: object supporting the buffer API required
File "/home/vaidas/.virtualenvs/streamlit/lib/python3.6/site-packages/streamlit/ScriptRunner.py", line 306, in _run_script exec(code, module.__dict__)
File "/home/vaidas/.virtualenvs/streamlit/lib/python3.6/site-packages/streamlit/hello.py", line 334, in <module> run()
File "/home/vaidas/.virtualenvs/streamlit/lib/python3.6/site-packages/streamlit/hello.py", line 308, in run demo()
File "/home/vaidas/.virtualenvs/streamlit/lib/python3.6/site-packages/streamlit/hello.py", line 78, in mapping_demo "data": from_data_file("bike_rental_stats.json"),
File "/home/vaidas/.virtualenvs/streamlit/lib/python3.6/site-packages/streamlit/caching.py", line 544, in wrapped_func return get_or_set_cache()
File "/home/vaidas/.virtualenvs/streamlit/lib/python3.6/site-packages/streamlit/caching.py", line 509, in get_or_set_cache code_hasher.update(func)
File "/home/vaidas/.virtualenvs/streamlit/lib/python3.6/site-packages/streamlit/hashing.py", line 185, in update self._update(self.hasher, obj, context)
File "/home/vaidas/.virtualenvs/streamlit/lib/python3.6/site-packages/streamlit/hashing.py", line 217, in _update hasher.update(b)

Is this a regression?

Tried to launch it for the first time.

Debug info

  • Streamlit version: 0.47.4
  • Python version: Python 3.6.8
  • Using virtualenv with virtualenvwrapper
  • OS version: Ubuntu 18.04
  • Browser version: Chrome Version 77.0.3865.90

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
rock3125commented, Oct 6, 2019

same error; Streamlit, version 0.47.4 Ubuntu 18.10 Python 3.6.8

However - trying python 2.7.15+ on the same OS DID work!

So it looks like they’ve tested it on Python 2 mostly and not really done much running on Python 3. Shame, considering Python 2 will reach the end of its life on January 1st, 2020.

0reactions
tvstcommented, Oct 11, 2019

Agreed with @roycoding. This looks like a dupe of #242. (Thanks Roy!)

The fix is coming soon with PR #254

(Closing this as a duplicate. Please reopen if you think this is not right)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apply Functions to Pandas DataFrame Using map, apply ...
What is Pandas map, apply, applymap and pipe? Photo by Sid Balachandran ... We will go through each one of them in detail...
Read more >
Difference between map, applymap and apply methods in ...
The applymap() method only works on a pandas Dataframe where a function is applied to every element individually. The function passed as an ......
Read more >
Encoder error while trying to map dataframe row to updated row
Unable to find encoder for type stored in a Dataset. Primitive types (Int, S tring, etc) and Product types (case classes) are supported...
Read more >
Common errors that may occur during editing—Help
For example, if the data you chose to edit is in a different coordinate system than the data frame, an information message appears...
Read more >
Pythonic Data Cleaning With Pandas and NumPy
Let's look at a simple example where we drop a number of columns from a DataFrame . First, let's create a DataFrame out...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found