Pipfile.lock已过期/无法创建常规文件“ requirements.txt”

时间:2020-03-28 15:51:51

标签: python heroku

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

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"

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

我尝试运行pipenv lock,但这不能解决问题

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