New Streamlit Release: 0.52.0

Highlights:

  • :outbox_tray: Preview release of the file uploader widget. To try it out just call
    st.file_uploader!
    Note that as a preview release things may change in the near future.
    Looking forward to hearing input from the community before we stabilize the
    API!

  • :wave: Support for emoji codes in
    st.write and st.markdown! Try it out with st.write("Hello :wave:").

Breaking changes:

  • :broom: st.pyplot now clears figures by default, since that’s what you want 99% of
    the time. This allows you to create two or more Matplotlib charts without
    having to call
    pyplot.clf
    every time. If you want to turn this behavior off, use
    st.pyplot(clear_figure=False)
  • :mega: st.cache no longer checks for input mutations. This is the first change
    of our ongoing effort to simplify the caching system and prepare Streamlit
    for the launch of other caching primitives like Session State!
10 Likes

Thats a good release. Thanks.

FYI. @RichardOberdieck.

2 Likes

Great news, I was looking forward to the file uploader function.
However, I’m getting a **AttributeError** : 'module' object has no attribute 'file_uploader error when trying to run locally

import streamlit as st
st.file_uploader('test')

EDIT: installing matplotlib 2.0.0 seems to have partially fixed the problem as scikit-image 0.14.1 required it. The widget appears in the app now but I’m getting a pop-up error

##### Bad message format

Tried to use SessionInfo before it was initialized
1 Like

I am getting the “Bad message format - Tried to use SessionInfo before it was initialized” pop-up message too. I created a new issue: https://github.com/streamlit/streamlit/issues/879

1 Like

Let me try those new features :slight_smile:

I am also getting this error message for a simple st.write("Hello")

Hey @pybokeh,

Sorry you’re having issues, to help troubleshoot, could you revert back to 0.51.0 and see if the same issue persists?

pip uninstall streamlit
pip install streamlit==0.51.0

@QAInsights & @Emmanuel_Pean are you on Windows machines as well?

1 Like

Just tested it in Windows machine with 0.51.0, the above issue is not happening.

@QAInsights, thanks for the reply on this and I passed the information on to the team. Looking into it now and will get back to everyone as soon as possible.

1 Like

Thanks for creating the issue! I just posted in there but wanted to sync up with this thread too, so I’ll repost here:

I’m trying to repro this, but having trouble. Here’s what I did:

  1. Install Windows 10 VM
  2. Installed Anaconda
  3. Open a new conda environment
  4. pip install streamlit
  5. streamlit hello
    …and it works fine.

Can you provide a little more info on how to reproduce?

Also: Can you try force-reloading your browser tab? Try Shift-F5 or Ctrl-Shift-R .
It’s possible you’re using an old tab that has version 0.51.0 of our Javascript running. (Which is something that we’re fixing right now, actually! See #536 )

Thank you :blush:

hi thiago
I am getting the same error.
I first installed with “pip install streamlit” but no new version was found, only after using “pip install streamlit == 0.52.0” the new version was installed and produced the error message. reverting back to 0.51.0 solved the problem. Looking forward to the new realease, sounds really exciting!

Clearing the browser cache did not resolve - still got the pop-up message. I did go into debug mode and this is what appears after visiting the URL:

Reusing preheated context for ws <streamlit.server.Server._BrowserWebSocketHandler object at 0x000002222601A710>
Server state: State.WAITING_FOR_FIRST_BROWSER -> State.ONE_OR_MORE_BROWSERS_CONNECTED
Report finished successfully; removing expired entries from MessageCache (max_age=2)
Received the following back message:
update_widgets {
}

Skipping rerun since the preheated run is the same

EDIT: Forgot to add that when reverting to 0.51.1, I no longer get the pop-up message.

1 Like

I am also experiencing two of the bugs discussed above when upgrading Streamlit from 0.51 to 0.52 for the awesome-streamlit.org repo.

I have reverted back to 0.51 for now.

1 Like

How do I open image in opencv. I have this code which gets uploaded image and displays it on streamlit:

uploaded_file = st.file_uploader("Choose a image file")
if uploaded_file is not None:
	image = uploaded_file.read()
	img = st.image(image, caption='Sunrise by the mountains', use_column_width=True)

My question is I want to read and save this uploaded file using:

import cv2
im1=cv2.imread(image)
im2=cv2.imwrite('out.jpg', im1)

How can I achieve this ?

@ajinkya933 you may need to post this question as a separate topic, this thread is to discuss 0.52.0 release.

Please see https://github.com/streamlit/streamlit/issues/888

1 Like

Version 0.52.1 has been released with the fix for the SessionInfo bug.

Thanks for the bug reports, everyone!

4 Likes

I did a fresh install on Linux in a virtualenv and found the media folder missing with the static font and icon files. Anybody seeing the same issue. That happens already on 0.52.1.

Franz

1 Like

Looking into it.