Skip to content
Advertisement

Pipenv stuck “⠋ Locking…”

Why is my pipenv stuck in the “Locking…” stage when installing [numpy|opencv|pandas]?

When running pipenv install pandas or pipenv update it hangs for a really long time with a message and loading screen that says it’s still locking. Why? What do I need to do?

Advertisement

Answer

Your package(s) are being installed and your wheel is being built

Perhaps better terminology to describe this state would be ‘Building and Locking…’ or something similar.

This is especially likely to happen if you’re installing numpy, opencv, pandas, or other large packages.

What’s going on in the background is that pipenv is downloading your package and maybe building the wheel.

The remedy in this case is often a strong dose of patience.

What is Locking?

To understand more about what “Locking” is in the pipenv context you can read more here: https://pipenv.kennethreitz.org/en/latest/basics/#pipenv-lock

$ pipenv lock is used to create a Pipfile.lock, which declares all dependencies (and sub-dependencies) of your project, their latest available versions, and the current hashes for the downloaded files. This ensures repeatable, and most importantly deterministic, builds.

However, there are times when it is not just a slow/large install, but is instead an issue with your Pipfile[.lock]. If you’re fairly certain that this is the problem try pipenv lock --clear and rerun your pipenv install command, also check this thread for more information.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement