'Can I upgrade an individual Python package?

Project specified python version: 3.7.9

urllib3 version from Pipfile.lock: "version": "==1.25.11"

Due to a security problem I want to update urllib3 to ">=1.26.5"

As this comes with Python, and we can't upgrade python right now I wanted to bump it separately. I'm fairly new to Python.

What I tried:

pipenv install urllib3~=1.26.5

What I got:

Resolving dependencies... ✘ Locking Failed! Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.

Is it not possible to ugrade urllib3 without bumping my Python version? If it is possible, what am I doing wrong? I also checked pipenv was up to date.



Solution 1:[1]

I had same problem, I just update my requests version in pipfile from

requests = "==2.22.0"

to

requests = "==2.27.1"

because usually urllib3 is a dependency of requests it should solve the problem.

If it didn't solve the problem you could use pipenv graph to find the dependency that depends on <1.26.5

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 littleali