首页 > 解决方案 > Pipfile.lock 已过期/无法创建常规文件“requirements.txt”

问题描述

当我尝试将我的项目推送到 Heroku 时,git push heroku master我得到以下输出:

remote: -----> Python app detected
remote:  !     Python has released a security update! Please consider upgrading to python-3.7.6
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: cp: cannot create regular file '/app/tmp/cache/.heroku/requirements.txt': No such file or directory
remote: -----> Installing python-3.7.3
remote: -----> Installing pip
remote: -----> Installing dependencies with Pipenv 2018.5.18…
remote:        Your Pipfile.lock (e78d47) is out of date. Expected: (d89661).
remote:        Aborting deploy.
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed

我试过跑步pipenv lock,但这并没有解决问题。

我的Pipfile样子是这样的:

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
flask = "*"
gunicorn = "*"
numpy = "*"
opencv-python = "*"

[requires]
python_version = "3.7"

有任何想法吗?

标签: pythonheroku

解决方案


我试过跑步pipenv lock,但这并没有解决问题

确保提交修改Pipfile.lock并将您的提交推送到 Heroku。仅在本地运行该命令是行不通的。


推荐阅读