我试图将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
项目档案结构:
runtime.txt
python-3.7.15
我试图在Stack溢出上找到答案,并找出类似的问题,但没有得到批准的答案,但没有被唤醒。我还尝试将Python版本与Heroku支持的Python运行时相匹配。
发布于 2022-10-26 02:25:08
首先,确保将runtime.txt
文件提交给git,否则Heroku将看不到它。
另外,请看每个堆栈所支持的版本。。您的消息说您使用的是Stack 22,但是Python3.7.15只受Stack 18和Stack 20的支持,这可以很容易地通过用heroku stack:set heroku-20
更改堆栈来解决。
https://stackoverflow.com/questions/74201751
复制相似问题