我嘗試將 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
專案檔案結構:

運行時.txt
python-3.7.15
我試圖在 Stack Overflow 上找到答案,并找到類似的問題,但沒有得到批準的答案,但沒有作業。我還嘗試將我的 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/qukuanlian/524070.html
標籤:Pythonheroku
上一篇:LaravelVue.jsHeroku[vite:load-fallback]無法加載''(由''匯入)“:ENOENT:沒有這樣的檔案或目錄,打開'
