What Does “pip install ~=” Mean?

Typically, when using pip install, versions are specified with >= or ==. This is also common in requirements.txt files.
While it might be fine for now, using >= can lead to dependency issues when installing the latest build.

When you want to apply the latest patches while maintaining the minor version, you can use ~=.
For example, using the command pip install -U pip will update pip to the latest version.

However, using pip install pip~=19.0 will update pip to the latest patch version based on 19.0.

I should develop the habit of using ~= frequently, especially due to dependencies.

Leave a Reply

Your email address will not be published. Required fields are marked *