nezort11
nezort11

Reputation: 633

Pipenv install package with exact latest version

When I run pipenv install requests it will add the following to Pipfile:

requests = "*"

But I want pipenv to add the latest package to Pipfile as a fixed (hard-coded) version that is exact or compatible:

requests = "=={latest_version}"
# or
requests = "~={latest_version}"

The problem with requests = "*", is that it causes pipenv to accidentally upgrade the package to the latest version (which might cause compatibility issues) when relocking (for example when installing a new package).

With node running npm install axios will add a fixed (compatible) version:

"axios": "^0.21.1" // compatible

Currently, I have to go to the https://pypi.org/project/requests/ to determine the latest version and then run pipenv install requests=={latest_version}. Further version updates are managed by dependabot.

Upvotes: 16

Views: 16220

Answers (2)

Joseph Lou
Joseph Lou

Reputation: 41

This isn't currently possible (as of writing this comment). You can upvote/check https://github.com/pypa/pipenv/issues/5531 to see the status of the issue.

Upvotes: 4

Billy Hunt
Billy Hunt

Reputation: 101

You may try:

pipenv install requests~=1.2

Upvotes: 8

Related Questions