python - 意外的 UTF-8 BOM 将 Django-app 部署到 Heroku
问题描述
我正在尝试将我的 Django 应用程序部署到Heroku。我已经完成了本教程中的几乎所有步骤。但是当我尝试完成最后一步($ 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
解决方案
推荐阅读
- python - How can run 10 minute minus the current time on python?
- arrays - 带有 if 条件的 .map() 是否会遍历数组中的所有索引?| JS 反应
- java - 如何使用 Java 创建 JSON 对象
- python - 函数内部的函数在 kivy 和 python 中的任何命令之前开始
- javascript - change a div class with JS and an event listener
- glsl - How to pass depth buffer to fragment shader using SCNTechnique
- pandas - How can I return value of a column based on the min value of one column and max value of another column?
- r - 根据条件仅在数据框列的子集中更改 NA
- java - 如何在第三方 android 视图的构造函数上处理“AttributeSet”
- java - 如何访问 JToolBar 中的 JRadioButton