我试图在我的heroku上运行一个python文件。我试图不设置一个构建包以及设置一个,但两者似乎都不起作用。我的分支中唯一的文件是一个.py,这里的.git文件夹是一个错误示例:
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Delta compression using up to 4 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 590 bytes | 590.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! No default language could be detected for this app.
remote: HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to google-results.
remote:发布于 2020-02-19 15:07:10
https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-python
在git中,您还需要以下两个文件: runtime.txt和requirements.txt
runtime.txt负责您的程序将要使用的Python。
cat runtime.txt
python-3.7.2支持的runtime.txt版本不时更改,因此请查看https://devcenter.heroku.com/articles/python-runtimes
需要requirements.txt来指定项目所依赖的https://pypi.org/库。确保指定一个版本以避免损坏。
您可以使用以下命令获得当前安装的python库的列表:python -m pip freeze > requirements.txt
https://stackoverflow.com/questions/60302574
复制相似问题