weixin_39562340
weixin_39562340
2020-12-26 19:32

[bug] python app via pipenv requires minor version set in Pipfile when upgrading major python versions

we're upgrading a python app from 2.7.8 to 3.7.13.

it fails at the python build step with minimal logs.


-----> Python app detected
-----> Found python-2.7.8, removing
-----> Installing python-3.7.3
-----> Installing pip
 !     Push rejected, failed to compile Python app.
 !     Push failed

we found that changing the python_version set in the Pipfile from 3.7 to 3.7.3 fixed the problem.

keeping the python_version at 3.7 and setting a runtime.txt instead (to 3.7.3) did not fix it

its preferable to keep the minor version out of the Pipfile. homebrew autoupdates the python version on macOS so it will be easy to have a scenario where a devleoper only has 3.7.4 on their computer where our app requires 3.7.3.

NOTE: this app worked as is without the minor version set when deploying a new fresh app. its particularly in the upgrade case where the deploy fails. most likely fails somewhere around here https://github.com/heroku/heroku-buildpack-python/blob/53e33bdf91dc1ac4295bcb4e9de6dc050fb31ead/bin/steps/python#L102-L112 but stdout/stderr are muted

cc

该提问来源于开源项目:heroku/heroku-buildpack-python

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

5条回答

  • weixin_39654848 weixin_39654848 4月前

    Hi is the application you're seeing this issue from on Cedar 14 stack? There's a known bug with Python 3.7+ on Cedar 14 that matches the error you listed, but since that stack is being deprecated this month it is wontfix. The recommended solution for this is to upgrade to Heroku 16 or 18.

    点赞 评论 复制链接分享
  • weixin_39644952 weixin_39644952 4月前

    Yes, it is on cedar 14. Will upgrade to 16 or 18. Thank you!

    点赞 评论 复制链接分享
  • weixin_39654848 weixin_39654848 4月前

    Got it. Hope that unblocks you!

    点赞 评论 复制链接分享
  • weixin_39644952 weixin_39644952 4月前

    It worked, thanks!

    点赞 评论 复制链接分享
  • weixin_39654848 weixin_39654848 4月前

    Whoops, unblocked but not closed. 🎉

    点赞 评论 复制链接分享

相关推荐