意外的UTF-8 BOM将Django-app部署到Heroku

时间:2018-08-10 12:07:49

标签: python django heroku

我正在尝试将Django应用程序部署到Heroku。我弄完了 tutorial中几乎所有步骤。但是,当我尝试完成最后一步($ git push heroku master)时,Heroku返回了以下错误:

-----> Python app detected
 !     The latest version of Python 3.6 is python-3.6.6 (you are using python-3.7.0, which is unsupported).
 !     We recommend upgrading by specifying the latest version (python-3.6.6).
       Learn More: https://devcenter.heroku.com/articles/python-runtimes
-----> Installing python-3.7.0
-----> Installing pip
Traceback (most recent call last):
  File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pipenv-to-pip", line 24, in <module>
    main()
  File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pipenv-to-pip", line 12, in main
    lockfile = json.load(f)
  File "/app/.heroku/python/lib/python3.7/json/__init__.py", line 296, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/app/.heroku/python/lib/python3.7/json/__init__.py", line 338, in loads
    s, 0)
json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)
 !     Push rejected, failed to compile Python app.
 !     Push failed

是什么原因引起的?我该如何解决?它可以由错误的python版本导致的吗(推荐为3.6.6,但我有3.7)?或者,如果有人遇到类似的问题,他正在哪里寻找解决方案? 任何帮助将不胜感激。

编辑

-----> Python app detected
 !     The latest version of Python 3.6 is python-3.6.6 (you are using python-3.6.6, which is unsupported).
 !     We recommend upgrading by specifying the latest version (python-3.6.6).
       Learn More: https://devcenter.heroku.com/articles/python-runtimes
-----> Installing python-3.6.6
 !     Requested runtime (python-3.6.6) is not available for this stack (heroku-16).
 !     Aborting.  More info: https://devcenter.heroku.com/articles/python-support
 !     Push rejected, failed to compile Python app.
 !     Push failed

0 个答案:

没有答案