How to run streamlit hello on netlify

I want to run streamlit hello within a Netlify service. I have a github repository with the following layout:

.
 |-runtime.txt
 |-requirements.txt
 |-netlify.toml
  1. runtime.txt contains the line 3.7 to select python 3.7
  2. requirements.txt contains the line streamlit, so pip will install streamlit.
  3. netlify.toml contains the two lines:
[context.production]
          command = "streamlit hello"

The issue is that according the Deploy log streamlit hello runs, but within the building and not within the context of the publishing,

10:05:13 PM: Pip dependencies installed
10:05:13 PM: Started restoring cached go cache
10:05:13 PM: Finished restoring cached go cache
10:05:13 PM: unset GOOS;
10:05:13 PM: unset GOARCH;
10:05:13 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
10:05:13 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
10:05:13 PM: go version >&2;
10:05:13 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
10:05:13 PM: go version go1.12 linux/amd64
10:05:13 PM: Installing missing commands
10:05:13 PM: Verify run directory
10:05:13 PM: Executing user command: streamlit hello
10:05:14 PM:   You can now view your Streamlit app in your browser.
10:05:14 PM:   Network URL: http://10.7.177.69:8501
10:05:14 PM:   External URL: http://35.229.117.47:8501

And Netlify is blocked on the last log line: 10:05:14 PM: External URL: http://35.229.117.47:8501 and doesn’t finish to build.

What do I miss in the configuration? How do I make sure the Netlify container runs all the pip commands according the requirements and also publish the service using streamlit hello.

Does streamlit have a build command to output a static web site (HTML files)?

I couldn’t find that in their CLI docs https://docs.streamlit.io/cli.html

It appears that streamlit hello is running a local server & not building any output HTML files for Netlify to deploy. This looks like why the build is stalling out

To add to what David said, our service will NOT run python (or any server process for you) at browse time. You might want to check out https://jamstack.org for more details on our hosting philosophy.

Hi, I created a simple personal blog site on Netlify but I have several Streamlit (python) applications that I would like to showcase on that blog site. Right now the applications are hosted on a paid cloud service (Heroku). Would it be possible to migrate the applications to Netlify if I upgrade my free account? similar question posted here in early 2020 and in which support explained “get that snake out of here (.py)”, but things change as you expand and technologies mature. Do you still not support that type of web application?

hi there @flights - we do not support python on the server side, no - the only way to have a python backed app would be to generate html locally and then push those built files.

here is another more detailed guide on what you currently can and can’t do on netlify: