heroku - 使用 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 中尝试了不同的布局,但到目前为止还没有运气。任何建议将不胜感激。
解决方案
我没有 setup.sh,我有一个简单的 Streamlit 应用程序正在运行。不过,我的 Procfile 略有不同:
web: streamlit run --server.enableCORS false --server.port $PORT app.py
推荐阅读
- android - 无法弄清楚如何将此字段保存到数据库中
- php - 多个请求同时绕过检查
- c# - .NET 数据层线程安全
- python-3.x - 如何将 Arduino 中的轮询数据捕获到 python 3 中?
- react-rails - React Rails“标识符'Set'未定义”
- c - C 程序 (Visual Studio) 中关于 Malloc 的编译错误(“void*”类型的值不能用于初始化“Item*”类型的实体
- wordpress - 将本地 wordpress 移动到实时服务器,以为我做的一切都是正确的
- python - 隐马尔可夫模型如何生成概率
- php - Heroku SSL 证书错误自定义域
- eclipse - PyDev Python简单的hello world程序不断终止而不向控制台返回任何内容