Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

== asks for a specific version, >= sets an inclusive minimum with no ceiling, and ~= sets a minimum while limiting matches to a release prefix. The number of components after ~= changes that prefix: ~=3.1 allows the 3.x series from 3.1, while ~=3.1.2 allows the 3.1.x series from 3.1.2.

What do pip version specifiers mean?

Version specifiers in Python package metadata express which package versions are acceptable. A requirement can contain multiple comma-separated clauses; a version must satisfy every clause. For example, >=1.4,<2 means version 1.4 or later, while also excluding version 2 and later. The PyPA version specifiers specification defines the comparison rules.

Specifier What it requires Example boundary
==3.1 A strict version match, with release-segment zero-padding equivalence Matches 3.1 and 3.1.0, not 3.1.1
>=3.1 An inclusive lower bound, with no upper bound in this clause 3.1 and later versions can match
~=3.1 A lower bound plus the 3.* release prefix 3.1 or later within 3.x; not 4.0
~=3.1.2 A lower bound plus the 3.1.* release prefix 3.1.2 or later within 3.1.x; not 3.2.0

These are acceptable-version rules, not a guarantee that a resolver will select every version that fits. Pre-release handling can affect which candidates are considered.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Is == an exact version pin?

Yes, unless you add a trailing wildcard. ==1.1 matches 1.1 and 1.1.0, because omitted trailing release segments are treated as zero for this comparison. It does not match 1.1.1, 1.1a1, 1.1.dev1, or 1.1.post1.

To request versions with the 1.1 release prefix, write ==1.1.*. That is a prefix match, not the same constraint as the strict ==1.1.

A strict pin can be useful for repeatable application deployments when the deployment process uses a shared package index and deliberately controls installed versions. For dependencies declared by published distributions, however, the specification strongly discourages == without a wildcard because strict pins complicate delivery of security fixes. See the PyPA specification’s guidance on version matching.

What does >= guarantee—and what does it leave open?

>=V is an inclusive lower bound under Python’s standard version ordering. A clause such as >=1.4 allows matching versions at or above 1.4, but it does not restrict how high the version may go. If the package needs a ceiling too, express one separately: >=1.4,<2. Because commas mean AND, both conditions must hold.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What does ~= mean in Python requirements?

The compatible-release operator combines a minimum version with a release-prefix limit. The specification describes ~=V.N as approximately equivalent to >=V.N, ==V.*. The prefix is based on the version components you write, so adding a component narrows the permitted series.

  • ~=3.1 behaves like >=3.1, ==3.*: it allows 3.1 and later 3.x releases, but not 4.0.
  • ~=3.1.2 behaves like >=3.1.2, ==3.1.*: it allows 3.1.2 and later 3.1.x releases, but not 3.2.0.
  • ~=3.1.0 also limits the prefix to 3.1.*; the extra zero is a release component that narrows the boundary.

A single-segment version such as ~=1 is not valid. The PyPA compatible-release rules define the required form and boundary.

Does ~=3.1 allow version 3.2?

Yes. 3.2 is within the 3.* prefix and is at least 3.1, so it satisfies ~=3.1. But ~=3.1.2 does not allow 3.2, because its prefix is limited to 3.1.*.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How do pre-releases and special versions affect these ranges?

A range that looks numerically inclusive does not necessarily mean a resolver will consider every pre-release within it. Under the specification, pre-releases—including development releases—are implicitly excluded unless they are already installed, explicitly requested, or the only available version that satisfies the requirement. Dependency resolution tools are expected to follow this default while allowing user-requested alternative behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The exclusive operators also have special rules: >V must not admit a post-release of V unless V itself is a post-release; <V must not admit a pre-release of V unless V itself is a pre-release. These operators also exclude local versions of the specified version, and ordered comparison specifiers cannot include local-version identifiers. See the PyPA rules for exclusive comparisons and pre-releases.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.