本人在Mac上部署网页,部署开始:
wumengtiandeMacBook-Pro:web wumengtian$ git push heroku master
但出现了问题:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing Python-3.6.2
remote: ! Requested runtime (Python-3.6.2) 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 safe-peak-44258.
前几天在windows系统部署都没有问题,现在出现pyhon版本不能用,于是我去看了提示的网站:https://devcenter.heroku.com/...
没有问题啊 我用的就是Python-3.6.2啊 然后又用Mac自带的2.7.10部署 还是显示上图一样的错误:2.7.10 is not available....
问下朋友们问题真的出在版本上吗?还是其他地方出错了?谢谢各位!
看了一圈帮助网站,建议使用 Python 3.5.1-3 试一试。
报错中提供的 Python Support 页面确实显示支持 Python 3.6.2,但在 Ubuntu Packages on Heroku Stacks 页面中,heroku-16 未显示支持 Python 3.6.2。如下图,中间一栏是旧版 cedar-14,右边一栏是 heroku-16。
可以看到,heroku-16 中的
python3
命令是支持 python 3.5.1-3 的。考虑到几天前还可以部署,可能的原因是近期 Heroku 作出了修改。注意 Python Support 页面的最近更新时间是 17 July 2017,而 Ubuntu Packages on Heroku Stacks 页面是刚刚更新的,更新时间是 23 August 2017。另外,heroku-16 介绍页面 Heroku-16 Stack 也写着支持 python 3.6,但更新时间是 6 June 2017。
所以,如果以最新的说明为准,heroku-16 目前不能部署 Python 3.6,建议在电脑上使用 virtualenv 建立虚拟 Python 环境或者暂时降级为 3.5。