无法部署Django应用Heroku,出现UnicodeDecodeError [duplicate]

rks48beu  于 2022-11-13  发布在  Go
关注(0)|答案(1)|浏览(115)

此问题在此处已有答案

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0 when deploying to Heroku(3个答案)
两个月前关门了。
当我尝试将我的应用程序推送到Heroku时,控制台显示

remote: -----> Building on the Heroku-22 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Python app detected
remote: -----> Using Python version specified in runtime.txt
remote: Traceback (most recent call last):
remote:   File "/tmp/codon/tmp/buildpacks/0f40890b54a617ec2334fac0439a123c6a0c1136/vendor/runtime-fixer", line 8, in <module>
remote:     r = f.read().strip()
remote:   File "/usr/lib/python3.10/codecs.py", line 322, in decode
remote:     (result, consumed) = self._buffer_decode(data, self.errors, final)
remote: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
remote: /tmp/codon/tmp/buildpacks/0f40890b54a617ec2334fac0439a123c6a0c1136/bin/steps/python: line 9: warning: command substitution: ignored null byte in input
remote: ' is not available for this stack (heroku-22).
remote:  !     For supported versions, see: https://devcenter.heroku.com/articles/python-support
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed

我该如何修复它?

zzwlnbp8

zzwlnbp81#

您的runtime.txt文件中的Python版本是什么?
根据Heroku的文件:

支持的运行时

  • python-3.10.7在所有支持的堆栈上(推荐)
  • python-3.9.14(在所有支持的堆栈上)
  • python-3.8.14仅适用于Heroku-18和Heroku-20
  • python-3.7.14仅适用于Heroku-18和Heroku-20

相关问题