Streamlit started giving 404: Not Found and no longer wants to work.
Added the multiselect example to my code:
options = st.multiselect(
'What are your favorite colors',
('Yellow', 'Red')
('Green', 'Yellow', 'Red', 'Blue'))
st.write('You selected:', options)
To get an app with a working multiselect
App gives 404: Not Found and nothing I do wants to make it work again.
yes
Streamlit version: 0.47.2
Python version: 3.7.1
Using Conda? PipEnv? PyEnv? Pex? pip on WinPython
OS version: Windows 10 version 1903
Browser version: Firefox 69.0
Tried changing the port, enabling debugging, killing the console and restarting. Not running jupyter-lab. Removing the multiselect code. Tried using http://localhost:8501/?a=1. Tried http://192.168.1.34:8501. Seems to be caching and always just returning the 404.
.streamlit hello now also 404's
pip uninstall streamlit and pip install streamlit also did not help
I am having the same issue, running on Anaconda but all other Debug info is the same otherwise.
Thank you for this issue. @tvst is looking into this right now and we'll get back to you!
@Code4SAFrankie and @Hubes92 : Could you please try:
pip install streamlit==0.47.0
and see if that fixes the problem?
Also, we are still looking into this, but we believe this issue has to do with Windows, not your code snippet, @Code4SAFrankie.
After correcting a small bug in your code @Code4SAFrankie, I found that this worked for me (on MacOS):
import streamlit as st
options = st.multiselect(
'What are your favorite colors',
('Green', 'Yellow', 'Red', 'Blue'),
('Yellow', 'Red'))
st.write('You selected:', options)

@Code4SAFrankie and @Hubes92 : Could you please try:
pip install streamlit==0.47.0and see if that fixes the problem?
Install 0.47.0 still gives me the same error unfortunately.
Update: I was able to install Streamlit and run streamlit hello on a Windows VM without issues*.
*_Well that's not 100% true... I ran into this #236 , but that's not Windows-specific and we have a fix coming out!_
Then I re-read the issue and realized you're using something called WinPython — so let me try that tomorrow.
Clearly I'm not a Windows expert :baby: , apologies for the delay!
Update: I was able to install Streamlit and run
streamlit helloon a Windows VM without issues*.*_Well that's not 100% true... I ran into this #236 , but that's not Windows-specific and we have a fix coming out!_
Then I re-read the issue and realized you're using something called WinPython — so let me try that tomorrow.
Clearly I'm not a Windows expert 👶 , apologies for the delay!
@tvst Im having the same issue but Im not using WinPython, I run with anaconda. The config.py also hard codes the port in to 8051, I changed it in that script to see if that helps but it didnt. I also found that the address was hard coded to localHost and changed to various other valid localhost addresses in Server.py etc but that didnt help either. Hope it helps somewhat or might just be useless information.
You probably already checked this, but just to get the obvious things out of the way: can you make sure Windows Firewall is not blocking Streamlit?
I noticed that when I first ran a Streamlit app on Windows I had to click through a dialog to allow it to use port 8501. I don't know if there's some situation that would cause the firewall to revoke that permission behind the scenes...
Yeah @tvst double checked that and changed the port as well in case that was the cause.
Facing the same issue
Same here. Win10 / Python 3.7.1
$ pip install streamlit
$ streamlit hello
I also tried the version 0.47.0 but same 404: Not Found
Firewall not blocking port 8501
Windows 10 / Python 3.6.7
Running "streamlit hello", gives me 404 error.
404: Not Found
Note that you can't run jupyter-lab and streamlit at the same time, since they both by default use the same port; but even getting the 404 without running jupyter-lab. Streamlit did initially work, but then stopped working and instead giving 404.
I've been able to get it to work while running JupyterLab by simply navigating to http://localhost:8501/index.html and then the page loads, otherwise its a 404.
Wow! Going to http://localhost:8501/index.html does not give me the 404 error, but instead correctly loads!!! Thanks!
@ismailuddin Thanks a million! It does work on http://localhost:8501/index.html
I've been able to get it to work while running JupyterLab by simply navigating to http://localhost:8501/index.html and then the page loads
Awesome, @ismailuddin !! Thanks for the work-around.
I'm still having problems reproducing the issue, though. So I have some more questions:
streamlit version to double-check which version you're on)localhost:8501/ and when you go to localhost:8501/index.html?Here's a page talking about how to grab a HAR file in different browsers: https://community.box.com/t5/Managing-Content-Troubleshooting/How-to-Generate-Network-Captures-for-Troubleshooting/ta-p/366
Note that you can't run jupyter-lab and streamlit at the same time, since they both by default use the same port;
Weird. On my machine, JupyterLab uses 8888 while Streamlit uses 8501. Are you saying they're both on 8501 on your machine?
Also, since version 0.47.0 Streamlit tries to find an open port when 8501 is taken. So even if JupyterLab is on that port Streamlit should run fine.
~Edit: I just realized the port-finder code isn't working on Python 2. We have a fix and will have it out with the next release.~ This is fixed since 0.47.4
Thank you @ismailuddin
Yup on my machine Jupyter Lab is using port 8888 as well so it shouldn't actually be interfering. Tbh, I didn't actually try without JLab since it's practically always running on my laptop. Unfortunately I don't have access to my Windows machine for a few days so won't be able to try any of that out just yet.
Sorry Jupyter Lab is using port 8888 on my machine.
Thanks, that makes sense! So I'm assuming the JupyterLab thing is a red herring at this point.
My best guess is that this would be fixed if we modified this function call in streamlit/server/Server.py to this:
routes.extend(
[
(r"/(.*)", StaticFileHandler, {
"path": "%s/" % static_path,
"default_filename": "index.html",
}),
]
)
But I can't repro the issue, so I can't verify that this fixes it. (Although we should probably do this anyway since it's cleaner than the current code!)
That said, if any enterprising soul would like verify that the above solves your problem, that would be amazing :smiley:
That change fixes the issue for me.
Awesome! Sending out a pull request right now.
work for me perfectly
pip install streamlit==0.47.0
@BENBOUZIANE : Could you please let us know if you're still seeing this issue in 0.50.2, the latest version of Streamlit? If so, we would greatly appreciate if you opened a new bug describing your experience.
Thank you for using Streamlit!
@treuille : Yes the problem still exists in version 0.50.2 which is why I installed version 0.47.0.
@treuille : I am able to see localhost in streamlit 0.51.0 but no cannot find the page on the network.
@kurt-rhee : I'm sorry you're having that problem. Could you please open a bug report and fill in the full form so that we can reproduce this issue? Thanks, and happy New Year! 🎆
@treuille thanks for the mention, I was able to figure the problem out!
Most helpful comment
I've been able to get it to work while running JupyterLab by simply navigating to http://localhost:8501/index.html and then the page loads, otherwise its a 404.