I can not register my Django project on Heroku

丶灬走出姿态 提交于 2020-01-22 01:51:06

问题


I updated the python version from 3.6.4 to 3.6.5 today. This is because, in the process of distributing to Heroku, it recommends version 3.6.5. Therefore, the following power shell contents were confirmed.

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

After changing my runtime.txt file to UTF-8, I now get the following error:

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

Why is python-3.6.5 being rejected? Isn't that exactly what Heroku says is the default version?


You were my good helper. Thank you, everybody!


回答1:


Heroku believes that your runtime.txt contains some extra characters:

ÿþpython-3.6.5

This is probably byte-order mark for a file encoded as UTF-16 in little-endian order. Make sure you're using a sane encoding for that file (and others). UTF-8 is a good choice in virtually all situations.




回答2:


You're trying to install ÿþpython-3.6.5 not python-3.6.5 as the console output suggests. Remove ÿþ and it should work as expected.



来源:https://stackoverflow.com/questions/50254723/i-can-not-register-my-django-project-on-heroku

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!