表題の通りになります。
osはWindows11になります。
ローカル上でアプリを起動できたので、アプリそのもののファイルにエラーが発生しているわけではないかなと思っています。
自分自身プログラミング経験1年未満、herokuのデプロイも数回しかしたことがなく不慣れかつGitなどの知識もあまりないといったレベルになります。
以下の記述でも至らない点が多々あるかもしれませんが、その際はぜひご指摘お願いいたします。
解決したいことなどなど
エラーの修正。
アプリケーションのデプロイ
実行したコマンド
デプロイするにあたり、git bash上で次のコマンドを実行しました。
heroku login heroku create アプリ名 git remote add heroku アプリのurl git add . git commit -m'1st commit' git push heroku master
発生したエラー
! Compiled slug size: 511.7M is too large (max is 500M). . . . ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/アプリ名'
まずslugsizeに関してですが、https://qiita.com/aquamarine/items/656d76425468ca47b5c9の記事を参考にプラグインのインストール等行いましたが、効果はありませんでした。
次に! [remote rejected] master -> master (pre-receive hook declined)に関してですが、色々調べて、Gitlab上の保護を外せばよいなどと書かれた記事を発見したのですが、そもそもGitlabを使用しているわけでもないし、Gitlabの知識もほぼ皆無なのでわかりませんでした、申し訳ありません。
Python
import streamlit as st from PIL import ImageFont from PIL import ImageDraw from azure.cognitiveservices.vision.computervision import ComputerVisionClient from azure.cognitiveservices.vision.computervision.models import OperationStatusCodes from azure.cognitiveservices.vision.computervision.models import VisualFeatureTypes from msrest.authentication import CognitiveServicesCredentials from array import array import os from PIL import Image import sys import time import json . . .
requirements.txt, setup.sh, Procfileの内容
requirements.txtは
pip freeze > requirements.txt
で作成しました。
requirements.txt
altair==4.2.0 anyio==3.3.0 argon2-cffi==20.1.0 asgiref==3.5.0 async-generator==1.10 attrs==21.2.0 Babel==2.9.1 backcall==0.2.0 beautifulsoup4==4.11.1 bleach==3.3.1 blinker==1.4 cachetools==5.0.0 certifi==2021.5.30 cffi==1.14.6 charset-normalizer==2.0.4 click==8.0.4 colorama==0.4.4 cycler==0.11.0 debugpy==1.4.1 decorator==5.0.9 defusedxml==0.7.1 entrypoints==0.3 fastapi==0.74.0 finance==0.2502 Flask==2.0.3 fonttools==4.29.1 gitdb==4.0.9 GitPython==3.1.27 google==3.0.0 google-auth==2.6.6 google-auth-oauthlib==0.5.1 gspread==5.3.2 gspread-dataframe==3.3.0 h11==0.13.0 idna==3.2 importlib-metadata==4.11.3 intel-openmp==2022.1.0 ipykernel==6.0.3 ipython==7.25.0 ipython-genutils==0.2.0 ipywidgets==7.6.3 itsdangerous==2.1.0 jedi==0.18.0 Jinja2==3.0.1 json5==0.9.6 jsonschema==3.2.0 jupyter==1.0.0 jupyter-client==6.1.12 jupyter-console==6.4.0 jupyter-core==4.7.1 jupyter-server==1.10.1 jupyterlab==3.1.1 jupyterlab-pygments==0.1.2 jupyterlab-server==2.6.1 jupyterlab-widgets==1.0.0 kiwisolver==1.3.2 lxml==4.8.0 MarkupSafe==2.0.1 matplotlib==3.5.1 matplotlib-inline==0.1.2 mistune==0.8.4 mkl==2022.1.0 multitasking==0.0.10 nbclassic==0.3.1 nbclient==0.5.3 nbconvert==6.1.0 nbformat==5.1.3 nest-asyncio==1.5.1 notebook==6.4.0 numpy==1.22.2 oauthlib==3.2.0 packaging==21.0 pandas==1.4.1 pandocfilters==1.4.3 parso==0.8.2 pickleshare==0.7.5 Pillow==9.0.1 prometheus-client==0.11.0 prompt-toolkit==3.0.19 protobuf==3.20.1 pyarrow==7.0.0 pyasn1==0.4.8 pyasn1-modules==0.2.8 pycparser==2.20 pydantic==1.9.0 pydeck==0.7.1 pygame==2.1.2 Pygments==2.9.0 Pympler==1.0.1 pyparsing==2.4.7 pyrsistent==0.18.0 python-dateutil==2.8.2 pytz==2021.1 pytz-deprecation-shim==0.1.0.post0 pyzmq==22.1.0 qtconsole==5.1.1 QtPy==1.9.0 requests==2.26.0 requests-oauthlib==1.3.1 requests-unixsocket==0.2.0 rsa==4.8 semver==2.13.0 Send2Trash==1.7.1 six==1.16.0 smmap==5.0.0 sniffio==1.2.0 soupsieve==2.3.2.post1 starlette==0.17.1 streamlit==1.9.0 tbb==2021.6.0 terminado==0.10.1 testpath==0.5.0 toml==0.10.2 toolz==0.11.2 tornado==6.1 traitlets==5.0.5 typing_extensions==4.1.1 tzdata==2022.1 tzlocal==4.2 urllib3==1.26.6 uvicorn==0.17.5 validators==0.19.0 watchdog==2.1.7 wcwidth==0.2.5 webencodings==0.5.1 websocket-client==1.1.0 Werkzeug==2.0.3 widgetsnbextension==3.5.1 yfinance==0.1.70 zipp==3.8.0
setup.sh
mkdir -p ~/.streamlit/ echo "\ [general]\n\ email = \"herokuに登録している、携帯のアドレス\"\n\ " > ~/.streamlit/credentials.toml echo "\ [server]\n\ headless = true\n\ enableCORS=false\n\ port = $PORT\n\ " > ~/.streamlit/config.toml
Procfile
web: sh setup.sh && streamlit run app.py
slugsizeの容量に関するエラーなどの修正の仕方など含め、各エラーの解決方法をお教えいただきたいです。
拙い文章で申し訳ありません。
どうかご協力お願いいたします。
以下、heroku logsでのエラー文になります。
! Compiled slug size: 511.7M is too large (max is 500M). ! See: http://devcenter.heroku.com/articles/slug-size ! Push failed
まだ回答がついていません
会員登録して回答してみよう