我无法在 Heroku 上注册我的 Django 项目

Boo*_*guy 1 python git django heroku

我今天将python版本从3.6.4更新到3.6.5。这是因为,在分发到 Heroku 的过程中,它建议使用 3.6.5 版本。因此,确认了以下电源外壳内容。

Writing objects: 100% (35/35), 11.68 KiB | 0 bytes/s, done.
Total 35 (delta 3), reused 0 (delta 0)
remote: Compressing source files... done.
remote: -----> Python app detected
remote:  !     The latest version of Python 3 is python-3.6.5 (you are using ÿþpython-3.6.5, which is unsupported).
remote:  !     We recommend upgrading by specifying the latest version (python-3.6.5).
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing ÿþpython-3.6.5
remote:  !     Requested runtime (ÿþpython-3.6.5) is not available for this stack (heroku-16).
remote:  !     Aborting.  More info: https://devcenter.heroku.com/articles/python-support
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote:
remote: !       Push rejected to XXXXXXXX.
remote:
To https://git.heroku.com/XXXXXXXX.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/XXXXXXXX.git
Run Code Online (Sandbox Code Playgroud)

将我的runtime.txt文件更改为 UTF-8 后,我现在收到以下错误:

Writing objects: 100% (35/35), 11.68 KiB | 0 bytes/s, done.
Total 35 (delta 3), reused 0 (delta 0)
remote: Compressing source files... done.
remote: -----> Python app detected
remote:  !     The latest version of Python 3 is python-3.6.5 (you are using python-3.6.5, which is unsupported).
remote:  !     We recommend upgrading by specifying the latest version (python-3.6.5).
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.6.5
remote:  !     Requested runtime (python-3.6.5) is not available for this stack (heroku-16).
remote:  !     Aborting.  More info: https://devcenter.heroku.com/articles/python-support
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to XXXXXXXX.
remote:
To https://git.heroku.com/XXXXXXXX.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/XXXXXXXX.git
Run Code Online (Sandbox Code Playgroud)

为什么会python-3.6.5被拒绝?这不正是 Heroku 所说的默认版本吗?


你是我的好帮手。谢谢大家!

Chr*_*ris 5

Heroku 认为您runtime.txt包含一些额外的字符:

ÿþpython-3.6.5
Run Code Online (Sandbox Code Playgroud)

这可能是以 little-endian order 编码为 UTF-16 的文件的字节顺序标记。确保您对该文件(和其他文件)使用了合理的编码。UTF-8 几乎在所有情况下都是不错的选择。