Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mim conflicts with pip and doesn't allow installing mmdet when using pip==23.2.1 (repeated download) #226

Open
apacha opened this issue Aug 21, 2023 · 0 comments

Comments

@apacha
Copy link

apacha commented Aug 21, 2023

Describe the bug
Pip and mim conflict in their latest version (pip==23.2.1) and mmdet can't be installed anymore.
The highest pip version that worked was 23.1.2.

Reproduction

Building this docker image will fail:

FROM python:3.8.13-slim

RUN apt-get update && apt-get install -y gnupg

RUN pip install pip==23.2.1
# Equivalent to `RUN pip install --upgrade pip` as of 21.08.2023
RUN pip --version

# Installing mmdet and mmcv
RUN pip install torch==1.10.0 torchvision==0.11.1
RUN pip install -U openmim
RUN mim install mmcv-full==1.4.4 mmdet==2.21.0 mmocr==0.6.1

# Entry point
CMD ["/bin/bash"]

after printing many of these:

Collecting mmdet==2.21.0
  Downloading mmdet-2.21.0.tar.gz (689 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 689.4/689.4 kB 15.5 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Saved /tmp/tmp0ynkm75l/mmdet-2.21.0.tar.gz
Collecting mmdet==2.21.0
  Using cached mmdet-2.21.0.tar.gz (689 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Saved /tmp/tmp1mh3679a/mmdet-2.21.0.tar.gz
Collecting mmdet==2.21.0
  Using cached mmdet-2.21.0.tar.gz (689 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Saved /tmp/tmpcj8tumsq/mmdet-2.21.0.tar.gz
Collecting mmdet==2.21.0
  Using cached mmdet-2.21.0.tar.gz (689 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Saved /tmp/tmpxg1wxzn3/mmdet-2.21.0.tar.gz
Collecting mmdet==2.21.0
  Using cached mmdet-2.21.0.tar.gz (689 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Saved /tmp/tmplsc35t4e/mmdet-2.21.0.tar.gz
Collecting mmdet==2.21.0
  Using cached mmdet-2.21.0.tar.gz (689 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Saved /tmp/tmpamjr9wyp/mmdet-2.21.0.tar.gz
Collecting mmdet==2.21.0
  Using cached mmdet-2.21.0.tar.gz (689 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Saved /tmp/tmpc7kq9oee/mmdet-2.21.0.tar.gz

whereas

FROM python:3.8.13-slim

RUN apt-get update && apt-get install -y gnupg

RUN pip install pip==23.0.0
RUN pip --version

# Installing mmdet and mmcv
RUN pip install torch==1.10.0 torchvision==0.11.1
RUN pip install -U openmim
RUN mim install mmcv-full==1.4.4 mmdet==2.21.0 mmocr==0.6.1

# Entry point
CMD ["/bin/bash"]

works.

To reproduce the issue, copy the code from above into a file called test.dockerfile and then run docker build -f test.dockerfile .

Environment

Docker (see above image)

Error traceback

pip download failed with args: ['mmdet==2.21.0', '-d', '/tmp/tmp0ynkm75l', '--no-deps', '--no-binary', ':all:']
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 180, in exc_logging_wrapper
    status = run_func(*args)
  File "/usr/local/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 248, in wrapper
    return func(self, options, args)
  File "/usr/local/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 377, in run
    requirement_set = resolver.resolve(
  File "/usr/local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 92, in resolve
    result = self._result = resolver.resolve(
  File "/usr/local/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/local/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 427, in resolve
    failure_causes = self._attempt_to_pin_criterion(name)
  File "/usr/local/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 239, in _attempt_to_pin_criterion
    criteria = self._get_updated_criteria(candidate)
  File "/usr/local/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 229, in _get_updated_criteria
    for requirement in self._p.get_dependencies(candidate=candidate):
  File "/usr/local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/provider.py", line 244, in get_dependencies
    return [r for r in candidate.iter_dependencies(with_requires) if r is not None]
  File "/usr/local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/provider.py", line 244, in <listcomp>
    return [r for r in candidate.iter_dependencies(with_requires) if r is not None]
  File "/usr/local/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 241, in iter_dependencies
    requires = self.dist.iter_dependencies() if with_requires else ()
  File "/usr/local/lib/python3.8/site-packages/pip/_internal/metadata/pkg_resources.py", line 216, in iter_dependencies
    return self._dist.requires(extras)
  File "/usr/local/lib/python3.8/site-packages/mim/commands/install.py", line 207, in patched_requires
    mmdeps_text = get_mmdeps_from_mmpkg(self.project_name,
  File "/usr/local/lib/python3.8/site-packages/mim/commands/install.py", line 321, in get_mmdeps_from_mmpkg
    mminstall_content = get_mminstall_from_pypi(mmpkg, index_url=index_url)
  File "/usr/local/lib/python3.8/site-packages/mim/commands/install.py", line 351, in get_mminstall_from_pypi
    exit(status_code)
  File "/usr/local/lib/python3.8/_sitebuiltins.py", line 26, in __call__
    raise SystemExit(code)
SystemExit: 2

Bug fix
Not sure, which subsystem of pip conflicts here with mim, but downgrading pip fixes the problem, but is not a satisfying solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant