[Django]-Pipfile.lock out of date

86👍

Experienced the same problem while working on a project, in the branch you are pushing to Heroku, run

pipenv lock

and it will update the Pipfile.lock file. 🙂

7👍

Updating my pipenv: pip install pipenv --upgrade
then doing: pipenv lock
then do a commit

fixed this for me

3👍

I removed the Pipfile.lock and commited it’s deletion. Heroku’s build process complained about it not being there, but it did deploy successfully…

-----> Python app detected
 !     No 'Pipfile.lock' found! We recommend you commit this into your repository.
-----> Installing pip
-----> Installing dependencies with Pipenv 11.8.2…
       Installing dependencies from Pipfile…
-----> Discovering process types
       Procfile declares types -> worker
-----> Compressing...
       Done: 189.9M
-----> Launching...
       Released v5

3👍

If there is already a Pipfile created, delete it and push deploy it again. It should re-install your dependencies. That is what worked for me.

2👍

The simplest way to deal with this is to run :
pipenv lock
and then git commit -am "updated pipfile",
git push && git push heroku master

These commands do the same exact thing as some of the other commands listed in other answer but well, these might do it a bit faster.

2👍

I have experienced the same problem today, so I solved in the way, the guy mentioned below, by updating my pipenv – pip install pipenv --upgrade and then hitting pipenv lock. This is the way to go, and solves the most cases. Also, after that do not forget to git add, commit and to push to heroku! Hope that helps!

1👍

You should provide either a:

  1. Pipfile and corresponding Pipfile.lock

or

  1. requirements.txt (and optionally runtime.txt)

If you are using a Pipfile then git rm requirements.txt runtime.txt and make sure to git add Pipfile Pipfile.lock. git commit and then try your git push to heroku.

https://devcenter.heroku.com/articles/python-runtimes

1👍

I had the same problem and it was due to a symbolic link pointing to Pipfile.lock.

After cloning the repo on my local mac OS environment, for some reasons, the original link was kind of broken and this resulted in Your Pipfile.lock (3b2ba9) is out of date. Expected: (83a5b4) when pushing to Heroku.

Just deleting the “old” symbolic link and recreating it from my local env solved the issue.

0👍

Using the Heroku CLI, I was running git push heroku master from a local branch that was not master, when this exact error appeared:

remote: -----> Python app detected
remote: -----> Installing pip
remote: -----> Installing dependencies with Pipenv 2018.5.18…
remote:        Your Pipfile.lock (38bf21) is out of date. Expected: (e4987e).
remote:        Aborting deploy.
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...

Deploying from the master branch fixed it.

If you want to push a local branch to the Heroku master that is not master, run git push heroku branchname:master.

-2👍

Just another tip: Make sure to do a git add . and git commit -m "whatever" if you’ve made updates to your Pipfile.lock and don’t see any changes. 🙂

Leave a comment