Skip to content

pip Dependency Resolver Selects Incompatible Package Version Leading to Installation Failure for AutoGluon #12990

@tonyhoo

Description

@tonyhoo

Description

Starting around this Tuesday (10/01/2024), we got reports from users on installation failure of AutoGluon on previous working releases. When installing autogluon==1.1.1 using pip, the dependency resolver selects an older version of onnx (1.10.0), which fails to build due to missing files (specifically requirements.txt). Previously, pip would select a compatible version of onnx (e.g., 1.16.2 or 1.17.0), and the installation would succeed without issues. Meanwhile, we noticed that uv pip install autogluon==1.1.1 and pip install autogluon==1.1.1 --use-deprecated=legacy-resolver works as expected.

This change in behavior suggests a potential issue with the dependency resolution in pip, possibly related to recent updates either in pip itself or in one of the transitive dependencies. After some deep dive on our side, we are not able to pinpoint the root cause of the issue and would like to seek guidance from pip community for help. Any pointers would be appreciated

Expected behavior

  • pip should resolve and install compatible versions of all dependencies required by autogluon==1.1.1.
  • Specifically, it should select a version of onnx that successfully installs (e.g., onnx==1.17.0) instead of an older, incompatible version (onnx==1.10.0).

pip version

24.2

Python version

3.8, 3.9, 3.10, 3.11

OS

Linux x86_64/ARM, macOS Intel/ARM

How to Reproduce

  1. Create a new virtual environment:
python -m venv test_env
source test_env/bin/activate 
  1. Upgrade pip to the latest version:
pip install --upgrade pip
  1. Attempt to install autogluon==1.1.1 or any earlier versions:
pip install autogluon==1.1.1
  1. Observe the installation failure, particularly with the onnx package.

Output

Collecting autogluon==1.1.1
  Using cached autogluon-1.1.1-py3-none-any.whl (9.5 kB)
Collecting autogluon.core[all]==1.1.1
  Using cached autogluon.core-1.1.1-py3-none-any.whl (207 kB)
# ... (additional output truncated for brevity)
Collecting onnx
  Using cached onnx-1.10.0.tar.gz (10.0 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [11 lines of output]
      /tmp/pip-install-xxxxxx/onnx/setup.py:36: DeprecationWarning: Use shutil.which instead of find_executable
        CMAKE = find_executable('cmake3') or find_executable('cmake')
      /tmp/pip-install-xxxxxx/onnx/setup.py:37: DeprecationWarning: Use shutil.which instead of find_executable
        MAKE = find_executable('make')
      fatal: not a git repository (or any of the parent directories): .git
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-xxxxxx/onnx/setup.py", line 318, in <module>
          raise FileNotFoundError("Unable to find " + requirements_file)
      FileNotFoundError: Unable to find requirements.txt
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    S: needs triageIssues/PRs that need to be triagedtype: bugA confirmed bug or unintended behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions