2

我对构建包感到不安,但它没有用,而且我确实有 requirements.txt 和 procfile 以及虚拟环境。

 (deploy) C:\Users\Samar\Desktop\deploy\blog>git push heroku master
 Counting objects: 127, done.
 Delta compression using up to 4 threads.
 Compressing objects: 100% (122/122), done.
 Writing objects: 100% (127/127), 45.25 KiB | 0 bytes/s, done.
 Total 127 (delta 47), reused 0 (delta 0)
 remote: Compressing source files... done.
 remote: Building source:
 remote:
 remote: -----> Python app detected
 remote: -----> Installing Python 3.6.0
 remote: -----> Installing pip
 remote: -----> Installing requirements with pip remote:/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/bin/steps/pip-install: line 5: /app/.heroku/python/bin/pip: No such file or directory
 remote:  !     Push rejected, failed to compile Python app.
 remote:
 remote:  !     Push failed
 remote: Verifying deploy...
 remote:
 remote: !       Push rejected to trueblog.
 remote:To https://git.heroku.com/trueblog.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/trueblog.git'
4

2 回答 2

2

Heroku仅支持runtime.txt. 它们目前仅支持 2.7.13 或 3.6.1。如果您指定任何其他运行时版本,则会收到这个完全无用的错误。

更改您runtime.txt以使用受支持的版本之一。

于 2017-05-09T20:58:50.913 回答
0

我在使用 python 3.5.1 时遇到了同样的问题,但是当我升级到 python 3.6.1 时,一切正常。

创建一个runtime.txt文件并将其添加python-3.6.1到其中,然后将其放入您拥有 manage.py 文件的基本目录中。那应该可以解决您的问题。

于 2017-05-13T19:04:06.200 回答