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

Won't opencv-python and opencv-contrib-python conflict with each other? They are both in requirements! #11555

Open
sisrfeng opened this issue Jan 30, 2024 · 2 comments
Assignees

Comments

@sisrfeng
Copy link

请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem

  • 系统环境/System Environment:
  • 版本号/Version:Paddle: PaddleOCR: 问题相关组件/Related components:
  • 运行指令/Command Code:
  • 完整报错/Complete Error Message:

我们提供了AceIssueSolver来帮助你解答问题,你是否想要它来解答(请填写yes/no)?/We provide AceIssueSolver to solve issues, do you want it? (Please write yes/no):no

请尽量不要包含图片在问题中/Please try to not include the image in the issue.

From google's Bard

You're absolutely right! Having both opencv-python and opencv-contrib-python listed in the requirements.txt of the PaddleOCR GitHub repository can indeed lead to conflicts. Here's why:

  1. Redundancy: opencv-contrib-python is essentially an extension of opencv-python, containing additional modules and algorithms. Installing both packages installs many of the same files, potentially causing version clashes and unexpected behavior.
  2. Version Mismatch: If the specified versions of opencv-python and opencv-contrib-python differ, pip might not be able to resolve the conflict, leading to installation errors or missing functionalities.
  3. Dependency Issues: Other dependencies in the project might have specific requirements for either opencv-python or opencv-contrib-python. Having both listed could lead to unexpected dependency conflicts for those libraries.

Solutions:

There are a couple of ways to address this redundancy and potential conflict:

  • Use opencv-contrib-python only: Since it includes all functionalities of opencv-python, using only opencv-contrib-python is sufficient. This simplifies the dependency list and avoids potential conflicts.
  • Specify version compatibility: If there are specific reasons for needing both packages, ensure their versions are compatible and explicitly specify them in the requirements.txt using version specifiers (e.g., opencv-python==4.5.5, opencv-contrib-python==4.5.5).
  • Consider alternatives: Depending on your specific needs, there might be alternative libraries or functionalities within PaddleOCR that can replace the need for both opencv-python and opencv-contrib-python.

It's generally recommended to avoid having both packages listed unless absolutely necessary. Choosing the appropriate approach depends on your specific requirements and the functionalities you need in your project.

I hope this explanation clarifies the potential conflict and provides helpful solutions!

@sisrfeng
Copy link
Author

I guess this is relevant: aleju/imgaug#473

@TingquanGao
Copy link
Collaborator

Thanks~
Could you please provide the steps for reproducing the conflicts? We would like to check and fix.

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

3 participants