[英]ModuleNotFoundError: No module named 'streamlit' when loading into my Heroku app
I'm using Python 3.8.5我正在使用 Python 3.8.5
I've made an app in Python that uses Streamlit, and when I deploy it using Heroku, I get this error when loading into the page.我在 Python 中制作了一个使用 Streamlit 的应用程序,当我使用 Heroku 部署它时,加载到页面时出现此错误。
My requirements.txt
file contains all the packages and their versions including Streamlit.我的
requirements.txt
文件包含所有包及其版本,包括 Streamlit。
matplotlib==3.3.3
pandas==1.1.5
numpy==1.19.5
streamlit==0.74.1
tensorflow-cpu==2.4.0
seaborn==0.11.1
Pillow==8.1.0
My setup.sh
file:我的
setup.sh
文件:
mkdir -p ~/.streamlit/
echo "\
[server]\n\
headless = true\n\
port = $PORT\n\
enableCORS = false\n\
\n\
" > ~/.streamlit/config.toml
My Procfile
:我的
Procfile
:
web: sh setup.sh && streamlit run site.py
I've tried several different versions of Streamlit but I always get the same the same error.我尝试了几种不同版本的 Streamlit,但我总是得到相同的错误。 Any help would be greatly appreciated!
任何帮助将不胜感激!
Change the name of your site from site.py
to something else, for example my_site.py
.将您的站点名称从
site.py
更改为其他名称,例如my_site.py
。 Streamlit tries to import a module called site
but your file is named site.py
. Streamlit 尝试导入一个名为
site
的模块,但您的文件名为site.py
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.