Deploying a Streamlit app in Pythonanywhere

Hi guys!

Do you know if there would be any challenges in deploying a Streamlit app on PythonAnywhere (https://www.pythonanywhere.com/)?

I’m looking for a quick and simple alternative to Heroku as unfortunately I’d need to deploy several apps on a laptop and I won’t be able to download Heroku’s CLI there (which I believe is mandatory to deploy apps?).

Happy to hear about any other alternatives for an easy Streamlit app deployment! :slight_smile:

Thanks,
Charly

Great, this is my doubt too.

Hi, has anyone tried installing and running the library from pythonanywhere ?

1 Like

I’ve never tried but I suppose it should be do-able.

I use either Heroku or Streamlit Sharing.

Thanks,
Charly

FTFY :laughing:

2 Likes

This product needs to be portable on the web, a platform where you have to ask for hosting consideration and once deployed they are the only option is no option at all.

This is what I found so far, in regards to my question.

I imagine one of the reasons Streamlit devs chose Tornado as a framework was based on its asynchronous capabilities, unfortunately pythonanywhere only supports WSGI and Stramlit doesn’t. Streamlit might install and partially run on pythonanywhere but if/when it tries to make an asynchronous call an error will be generated.

I will not try to install the Streamlit in pythonanywhere based on what I found, for me Streamlit will have to wait.

Some of my reference material:

Streamlite forum

“Streamlit runs its own web server via the Tornado framework, and there’s no good way to embed a Streamlit app inside a Flask server.”

Pythonanywhere

“However, if you’re using Tornado as a web framework and don’t care about the asynchronous stuff, you can use it on PythonAnywhere.”

Streamlite forum

“At this time Streamlit doesn’t support the WSGI protocol”

2 Likes

You could use the redirect to send your users from your flask app to your streamlit app or you can embed your streamlit through an iframe in your html.