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

[Feature] Improve opencv normal-vs-headless requirements #1196

Open
Erotemic opened this issue Jun 10, 2023 · 1 comment · May be fixed by #1195
Open

[Feature] Improve opencv normal-vs-headless requirements #1196

Erotemic opened this issue Jun 10, 2023 · 1 comment · May be fixed by #1195

Comments

@Erotemic
Copy link

What is the feature?

I'd like to propose a new way to specify the opencv requirement (as either opencv-python-headless or opencv-python) using the setup.py's extra's mechanism.

Currently, if you aren't very careful about how you install mmengine / mmcv you will end up with pip in a state where it thinks there is some dependency conflict, e.g.

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
mmengine 0.7.4 requires opencv-python>=3, which is not installed.
mmcv 2.0.0 requires opencv-python>=3, which is not installed.

The user needs to preinstall opencv and then there is a dynamic "choose requirement" part of the mmengine / mmcv setup.py that determines which one (opencv-python-headless or opencv-python) it will register as depending on. This is not ideal.

Instead it would be better if the user could declare which one they wanted to depend on and skip that check entirely. In this way the user could run:

pip install mmengine[cv2-headless]
OR
pip install mmengine[cv2-graphics]

and tell it which version of opencv it will depend on.

I have two preliminary PRs that layout the initial groundwork for this change: open-mmlab/mmcv#2775 and #1195

As-is the PRs won't entirely fix the problem, but they are the first step. The second step would be to remove the dynamic modification of install_requires so pip install mmengine does not depend on either opencv at all by default.

With these changes the old way of preinstall opencv and then mmengine would still work, but it would also allow the much cleaner explit one-step install commands.

Any other context?

No response

@zhouzaida zhouzaida linked a pull request Jun 15, 2023 that will close this issue
@zhouzaida
Copy link
Member

Hi, thanks for your report. I have left a comment in the PR #1195 and we can continue the discussion in it.

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

Successfully merging a pull request may close this issue.

2 participants