How do you resolve Python package dependencies with pipenv? How do you resolve Python package dependencies with pipenv? python python

How do you resolve Python package dependencies with pipenv?


I get that error constantly. Clearing the cache in the lock file works beautifully every time.

$ pipenv lock --pre --clear


You can't. At the moment, pipenv doesn't offer anything for an explicit override of requirement constraints.

As a workaround, you can put dependencies that you want to override to dev-packages as those will be overridden by packages, so this Pipfile should install pckg3>=4.1.0:

# Pipfile...[packages]pckg1 = "==3.0.0"[dev-packages]pckg2 = "==1.0.2"

If you now lock and install:

$ pipenv lock --dev$ pipenv install --dev

the requirement ==4.0.11 will be overridden by >=4.1.0. This is ugly if you ask me because this is not what development packages are meant for and you're changing the role of pckg2 dependency in project, but I don't see any better way here.


This works when there are unfinished routines on pipfile.

Once I made a mistake and run

pipenv install codecove # With an 'e' at the end

and the pipenv kept always trying to complete the installation with no success because the lib does not exist. I resolved it with:

pipenv uninstall codecove

and installed codecov after.

I tried to run

pipenv lock --clearpipenv lock --pre --clear

but only after uninstalled the lib with wrong name I succeeded.