{"id":24190,"library":"packvers","title":"packvers","description":"Core utilities for Python package versioning. A fork of `packaging` version 21.3 that reintroduces `LegacyVersion` and supports PEP 440 / legacy comparison. Latest version 21.5, requires Python >=3.6.","status":"active","version":"21.5","language":"python","source_language":"en","source_url":"https://github.com/nexB/packvers","tags":["versioning","packaging","fork","legacy"],"install":[{"cmd":"pip install packvers","lang":"bash","label":"install from PyPI"}],"dependencies":[],"imports":[{"note":"`LegacyVersion` is removed from `packaging` after 21.3; this fork restores it.","wrong":"from packaging.version import LegacyVersion","symbol":"LegacyVersion","correct":"from packvers.version import LegacyVersion"},{"note":"Same API as upstream `packaging.version.Version`.","wrong":null,"symbol":"Version","correct":"from packvers.version import Version"},{"note":"Same API as upstream.","wrong":null,"symbol":"SpecifierSet","correct":"from packvers.specifiers import SpecifierSet"}],"quickstart":{"code":"from packvers.version import Version, LegacyVersion\nfrom packvers.specifiers import SpecifierSet\n\nv = Version('1.2.3')\nprint(v)  # 1.2.3\nprint(SpecifierSet('>=1.0').contains(v))  # True\n\n# Legacy version support\nlv = LegacyVersion('1.2.3a')\nprint(lv)  # 1.2.3a","lang":"python","description":"Basic usage: parse and compare versions, including legacy format."},"warnings":[{"fix":"Use `from packvers.version import LegacyVersion` for legacy version support.","message":"`packvers.version.LegacyVersion` is available in this fork but not in `packaging>=21.3`. If you accidentally import from `packaging` expecting `LegacyVersion`, you'll get an `ImportError`.","severity":"gotcha","affected_versions":">=21.5"},{"fix":"If you don't need legacy version support, switch to `packaging`.","message":"`packvers` is a fork of an older version of `packaging`. It may not receive updates aligning with newer PEP standards. Consider using `packaging` directly unless you specifically need `LegacyVersion`.","severity":"deprecated","affected_versions":"*"},{"fix":"Use a virtual environment and install only the required library.","message":"Installing both `packaging` and `packvers` can cause dependency conflicts or namespace shadows if used together. Ensure only one is installed.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade to `packvers>=21.5` with `pip install --upgrade packvers` and ensure `packaging` is not installed.","cause":"You may have an older version of `packvers` that doesn't include `LegacyVersion`, or you accidentally installed `packaging` instead.","error":"from packvers.version import LegacyVersion\nImportError: cannot import name 'LegacyVersion' from 'packvers.version'"},{"fix":"Use `packvers.version.LegacyVersion` instead, or downgrade `packaging` to 20.9.","cause":"`LegacyVersion` was removed from `packaging` in version 21.0.","error":"from packaging.version import LegacyVersion\nImportError: cannot import name 'LegacyVersion' from 'packaging.version'"},{"fix":"Uninstall conflicting packages and install `packvers` via `pip install packvers`.","cause":"You may have accidentally installed `packver` (wrong name) or the import path is incorrect.","error":"AttributeError: module 'packaging' has no attribute 'version'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}