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

2024-06-16 08:57:35 发布

您现在位置:Python中文网/ 问答频道 /正文

我今天将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

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

^{pr2}$

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


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


Tags: tohttpsgit版本comherokuremoteis
3条回答

不是这个!太荒谬了!我刚刚删除了运行时.txt文件。。。Heroku很好地部署了我的Django项目。当然有应用程序错误,但是。。。谢谢您!每个人都告诉我一些有用的东西。顺便说一句,我还是不知道为什么会正常部署。是否有理由删除运行时.txt文件?在

您正在尝试安装ÿþpython-3.6.5,而不是python-3.6.5,正如控制台输出所示。删除ÿþ,它应该可以正常工作。在

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

ÿþpython-3.6.5

这可能是byte-order mark for a file encoded as UTF-16 in little-endian order。确保您对该文件(和其他文件)使用的编码是正常的。UTF-8在几乎所有情况下都是一个不错的选择。在

相关问题 更多 >