我試圖將python應用程式部署到heroku,我已經在我的目錄的根目錄上有runtime.txt,但是我不知道為什么heroku找不到我指定的“runtime.txt”檔案并總是給出這個訊息:
Building on the Heroku-22 stack
-----> Determining which buildpack to use for this app
-----> Python app detected
-----> No Python version was specified. Using the buildpack default: python-3.10.8
To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
-----> Installing python-3.10.8


我試圖在stackoverflow上找到答案并找到沒有批準答案的類似問題,并且我嘗試將我的python版本與heroku支持的python運行時相匹配。
uj5u.com熱心網友回復:
首先,確保將runtime.txt檔案提交到 git,否則 Heroku 將看不到它。
另外,請查看每個堆疊支持的版本。您的訊息說您正在使用 Stack 22,但 Python 3.7.15 僅受 Stack 18 和 Stack 20 支持。這可以通過更改堆疊輕松解決heroku stack:set heroku-20。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/519352.html
標籤:Pythonheroku
