【问题标题】:Problem publishing Streamlit app with Heroku使用 Heroku 发布 Streamlit 应用程序时出现问题
【发布时间】:2020-11-12 10:47:06
【问题描述】:

这是我第一次尝试使用 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

setup.sh:

mkdir -p ~/.streamlit

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

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

【问题讨论】:

    标签: heroku streamlit


    【解决方案1】:

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

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

    【讨论】:

    • 谢谢,这已经解决了这个问题。我对这一切都很陌生,当这似乎是一个更好的解决方案时,setup.sh 是什么?我发现的每个教程都使用了一个。
    猜你喜欢
    • 2019-03-31
    • 1970-01-01
    • 2010-10-05
    • 1970-01-01
    • 2014-11-25
    • 2020-11-21
    • 2019-10-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多