表題の通りになります。
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
1import streamlit as st 2from PIL import ImageFont 3from PIL import ImageDraw 4from azure.cognitiveservices.vision.computervision import ComputerVisionClient 5from azure.cognitiveservices.vision.computervision.models import OperationStatusCodes 6from azure.cognitiveservices.vision.computervision.models import VisualFeatureTypes 7from msrest.authentication import CognitiveServicesCredentials 8 9from array import array 10import os 11from PIL import Image 12import sys 13import time 14 15import json 16. 17. 18. 19
requirements.txt, setup.sh, Procfileの内容
requirements.txtは
pip freeze > requirements.txt
で作成しました。
requirements.txt
1altair==4.2.0 2anyio==3.3.0 3argon2-cffi==20.1.0 4asgiref==3.5.0 5async-generator==1.10 6attrs==21.2.0 7Babel==2.9.1 8backcall==0.2.0 9beautifulsoup4==4.11.1 10bleach==3.3.1 11blinker==1.4 12cachetools==5.0.0 13certifi==2021.5.30 14cffi==1.14.6 15charset-normalizer==2.0.4 16click==8.0.4 17colorama==0.4.4 18cycler==0.11.0 19debugpy==1.4.1 20decorator==5.0.9 21defusedxml==0.7.1 22entrypoints==0.3 23fastapi==0.74.0 24finance==0.2502 25Flask==2.0.3 26fonttools==4.29.1 27gitdb==4.0.9 28GitPython==3.1.27 29google==3.0.0 30google-auth==2.6.6 31google-auth-oauthlib==0.5.1 32gspread==5.3.2 33gspread-dataframe==3.3.0 34h11==0.13.0 35idna==3.2 36importlib-metadata==4.11.3 37intel-openmp==2022.1.0 38ipykernel==6.0.3 39ipython==7.25.0 40ipython-genutils==0.2.0 41ipywidgets==7.6.3 42itsdangerous==2.1.0 43jedi==0.18.0 44Jinja2==3.0.1 45json5==0.9.6 46jsonschema==3.2.0 47jupyter==1.0.0 48jupyter-client==6.1.12 49jupyter-console==6.4.0 50jupyter-core==4.7.1 51jupyter-server==1.10.1 52jupyterlab==3.1.1 53jupyterlab-pygments==0.1.2 54jupyterlab-server==2.6.1 55jupyterlab-widgets==1.0.0 56kiwisolver==1.3.2 57lxml==4.8.0 58MarkupSafe==2.0.1 59matplotlib==3.5.1 60matplotlib-inline==0.1.2 61mistune==0.8.4 62mkl==2022.1.0 63multitasking==0.0.10 64nbclassic==0.3.1 65nbclient==0.5.3 66nbconvert==6.1.0 67nbformat==5.1.3 68nest-asyncio==1.5.1 69notebook==6.4.0 70numpy==1.22.2 71oauthlib==3.2.0 72packaging==21.0 73pandas==1.4.1 74pandocfilters==1.4.3 75parso==0.8.2 76pickleshare==0.7.5 77Pillow==9.0.1 78prometheus-client==0.11.0 79prompt-toolkit==3.0.19 80protobuf==3.20.1 81pyarrow==7.0.0 82pyasn1==0.4.8 83pyasn1-modules==0.2.8 84pycparser==2.20 85pydantic==1.9.0 86pydeck==0.7.1 87pygame==2.1.2 88Pygments==2.9.0 89Pympler==1.0.1 90pyparsing==2.4.7 91pyrsistent==0.18.0 92python-dateutil==2.8.2 93pytz==2021.1 94pytz-deprecation-shim==0.1.0.post0 95pyzmq==22.1.0 96qtconsole==5.1.1 97QtPy==1.9.0 98requests==2.26.0 99requests-oauthlib==1.3.1 100requests-unixsocket==0.2.0 101rsa==4.8 102semver==2.13.0 103Send2Trash==1.7.1 104six==1.16.0 105smmap==5.0.0 106sniffio==1.2.0 107soupsieve==2.3.2.post1 108starlette==0.17.1 109streamlit==1.9.0 110tbb==2021.6.0 111terminado==0.10.1 112testpath==0.5.0 113toml==0.10.2 114toolz==0.11.2 115tornado==6.1 116traitlets==5.0.5 117typing_extensions==4.1.1 118tzdata==2022.1 119tzlocal==4.2 120urllib3==1.26.6 121uvicorn==0.17.5 122validators==0.19.0 123watchdog==2.1.7 124wcwidth==0.2.5 125webencodings==0.5.1 126websocket-client==1.1.0 127Werkzeug==2.0.3 128widgetsnbextension==3.5.1 129yfinance==0.1.70 130zipp==3.8.0
setup.sh
1mkdir -p ~/.streamlit/ 2 3echo "\ 4[general]\n\ 5email = \"herokuに登録している、携帯のアドレス\"\n\ 6" > ~/.streamlit/credentials.toml 7 8echo "\ 9[server]\n\ 10headless = true\n\ 11enableCORS=false\n\ 12port = $PORT\n\ 13" > ~/.streamlit/config.toml
Procfile
1web: 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

回答1件
あなたの回答
tips
プレビュー