首页 > 解决方案 > 使用 Heroku 发布 Streamlit 应用程序时出现问题

问题描述

这是我第一次尝试使用 Streamlit 或 Heroku。我的应用程序使用 Streamlit 在本地运行,但在使用 Heroku 发布应用程序后尝试打开应用程序时遇到此错误:

2020-07-22T19:20:13.577096+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=ewan-app.herokuapp.com request_id =99a5e93d-8caa-458a-bf01-fae69aaa46e9 fwd="81.156.68.48" dyno=connect=service=status=503 bytes=protocol=https

2020-07-22T19:20:13.791262+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=ewan-app.herokuapp .com request_id=e4eea2e8-4fe3-46c4-996e-0d463bb36de0 fwd="81.156.68.48" dyno= connect= service= status=503 bytes= protocol=https

当我将应用程序脚本更改为以下内容时,也会发生同样的事情:

import streamlit as st
st.write("Hello world!")

所以我猜这是由于其他文件之一。我有requirements.txt:

streamlit==0.63.1

档案:

web:sh setup.sh && streamlit run app.py

设置.sh:

mkdir -p ~/.streamlit

echo "[server]
headless = true
port = $PORT
enableCORS = false
" > ~/.streamlit/config.toml

我尝试了一些我发现的不同建议,比如删除 Procfile 中 web: 和 sh 之间的空格,并在 setup.sh 中尝试了不同的布局,但到目前为止还没有运气。任何建议将不胜感激。

标签: herokustreamlit

解决方案


我没有 setup.sh,我有一个简单的 Streamlit 应用程序正在运行。不过,我的 Procfile 略有不同:

web: streamlit run --server.enableCORS false --server.port $PORT app.py


推荐阅读