Skip to content

Unhandled exception if version is not determinable #13443

@HenningUe

Description

@HenningUe

Description

Packages with incomplete version data cause an unhandled exception, see stacktrace below

Expected behavior

A comprehensive error message that tells the user which package is incomplete and what exactly is missing.

pip version

25.1.1

Python version

3.12

OS

Windows

How to Reproduce

  1. Setup a local package with pyproject-toml. Leave out the version info
  2. Inside the package put some dummy code under "src"
  3. Create a venv inside this package, e.g. ".venv"
  4. Call pip install .

Output

Looking in indexes: https://pypi.python.org/simple
Requirement already satisfied: pip in c:\work.venv\lib\site-packages (25.1.1)
ERROR: Error while checking for conflicts. Please file an issue on pip's issue tracker: https://github.com/pypa/pip/issues/new
Traceback (most recent call last):
File "C:\Work.venv\Lib\site-packages\pip_internal\commands\install.py", line 587, in _determine_conflicts
return check_install_conflicts(to_install)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Work.venv\Lib\site-packages\pip_internal\operations\check.py", line 116, in check_install_conflicts
package_set, _ = create_package_set_from_installed()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Work.venv\Lib\site-packages\pip_internal\operations\check.py", line 58, in create_package_set_from_installed
package_set[name] = PackageDetails(dist.version, dependencies)
^^^^^^^^^^^^
File "C:\Work.venv\Lib\site-packages\pip_internal\metadata\importlib_dists.py", line 175, in version
return parse_version(self._dist.version)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Work.venv\Lib\site-packages\pip_vendor\packaging\version.py", line 56, in parse
return Version(version)
^^^^^^^^^^^^^^^^
File "C:\Work.venv\Lib\site-packages\pip_vendor\packaging\version.py", line 200, in init
match = self._regex.search(version)
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions