poetry run streamlit hello
runs on local computer, but on Github Codespaces the page hangs at “Please wait…”. The port is forwarded to external URL.
Any clues why page is not rendering?
poetry run streamlit hello
runs on local computer, but on Github Codespaces the page hangs at “Please wait…”. The port is forwarded to external URL.
Any clues why page is not rendering?
Very early discussion on the same topic: Development on Github Codespace
Been struggling with this for a few hours now
Streamlit opens but doesn’t load any apps including streamlit hello
@robmarkcole are you still able to run streamlit in codespaces?
Hi, I had the same issue. I have solved this problem using this solution.
streamlit hello --server.enableCORS false --server.enableXsrfProtection false
Hi @fhtsibuya, welcome to the community and thanks for your solution!!
I’ve created a repo that includes the command line config options in a config.toml
, to avoid typing them each time you run an app:
Nice, thanks @fhtsibuya!
@snehankekre good idea having it in the config, didn’t realize that. Do you know if it’s possible to have multiple terminal commands [in devcontainer] on launch?
I want to have both pip install reqs and streamlit run with the server commands instead of having it be in config.toml
. This is because I have deployed an app via github and want --server.enableCORS false --server.enableXsrfProtection false
only when developing in codespaces to get it to display and not when deployed
@batman It is possible: devcontainer.json reference
Depending on your use-case, you can either use postCreateCommand
or postStartCommand
to run multiple commands, if each command is separated by &&
. For example
"postStartCommand": "apt-get install -y curl && pip install -r requirements.txt",
Or if you have a ton of commands to run, store them in a .sh
script, copy the script to the container, and run the bash script via the postStartCommand
.
Brilliant, thank you!
And btw I just tried running your repo in a code space and it gets stuck on the please wait screen again I guess something may have changed
I just noticed that too The behavior doesn’t appear to be deterministic / reliable. If you wait for a few minutes after the container starts to run streamlit hello
or streamlit run app.py
, it works as expected. If you run the app immediately, it seems to get stuck on the please wait screen.
I also observed that refreshing the page or restarting the app can sometimes get rid of the please wait screen.
Oh wow that’s very weird thank you for that tip, I’ve really been struggling to get this working lol
And refreshing hasn’t worked for me but maybe it’s because I always run it immediately. Will try waiting a little first, hopefully it works! Thanks again
@snehankekre were you able to use codespaces again? I haven’t been able to get it to work (at all lol)
I tried --server.enableWebsocketCompression=false
as well
@batman I did just get it running again by launching codespaces from my repo:
However, it isn’t reliable. I had to wait a full minute after streamlit hello
for the Please Wait ...
message to go away and for the app to work.
Thank you for checking again @snehankekre! I wonder whether it’s the server region (Europe) that’s causing a problem for me
Also, I don’t know whether it’s related but recently my app deployed via heroku stays on the “please wait…” screen for so much longer than it’s used to. Do you think it could be a similar issue? Running 1.10.0
Update: just tried launching the heroku app, it took about 6-7 minutes
I haven’t deployed to Heroku yet, so I have no comments I’ll defer to others in the community.
If you are running in Codespaces you may also need to change the visibility of port: 8501 to “public”. VSCode has a tab for ports and you will have 3 ports open.
Good news! Streamlit Community Cloud just published an update to automate creating a codespace in GitHub. You can either:
Happy Streamlit-ing!
Is there any chance that codespace would not show the simple browser when repository is private? Cuz I couldn’t make it to open preview on codespace, but app work on the other tab of the browser, although I want to see the changes instantly without committing each time.
Check your repository to make sure the .devcontainer/devcontainer.json
file got correctly added to your repository. That is the magic sauce that makes it all work. If you do not see that file, you can manually add it and restart your codespace.
You can see it as an example in in this example app repo.
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.