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

[Bug]: Dependencies in requirements.txt have module conflicts. #1808

Open
1 task done
unsatisfying opened this issue Jul 28, 2023 · 0 comments
Open
1 task done

[Bug]: Dependencies in requirements.txt have module conflicts. #1808

unsatisfying opened this issue Jul 28, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@unsatisfying
Copy link

What happened?

There are multiple dependencies mentioned in the requirements.txt file: opencv-python-headless and the following list are all depends on the opencv-python:

invisible-watermark
gfpgan
realesrgan
facexlib
albumentations
basicsr

These two packages have module conflicts. They share many modules (with different contents).
The official spec mentioned that the opencv-python package is for the desktop environment, while opencv-python-headless is for the server environment. The documentation also states that these two packages cannot be installed simultaneously (the exact wording is: “There are four different packages (see options 1, 2, 3, and 4 below) and you should SELECT ONLY ONE OF THEM.”). This is because they both use the same module name cv2.

During the installation process using pip, the package installed later will override the cv2 module from the previously installed package (specifically, the modules within the cv2 folders that exist in both packages). Furthermore, the dependency graph even includes different versions of these two packages. It is certain that the common files with the same path in these two packages contain different contents. Therefore, there may be functional implications when using them. However, without analyzing the specific code and function call hierarchy of this project, it can be stated that issues related to overwriting and module conflicts do exist.

Steps to Reproduce

pip install -r requirements.txt

Desired Change

Indeed, it is not an ideal behavior for modules to be overwritten, even if they are not actively used or if the overwritten module is the one being called. It introduces uncertainty and can cause issues in the long run, especially if there are changes or updates to the overwritten modules in future development. It is generally recommended to avoid such conflicts and ensure that only the necessary and compatible dependencies are declared in the requirements to maintain a stable and predictable environment for the project.

We believe that although this project can only modify direct dependencies and indirect dependencies are a black box, it is possible to add additional explanations rather than directly declaring both conflicting packages in the requirements.txt file.

Adding extra explanations or documentation about the potential conflicts and the need to choose only one of the conflicting packages can help developers understand the issue and make informed decisions. Including a clear instruction or warning in the project’s documentation can guide users to choose the appropriate package based on their specific requirements.

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

No response

Where are you running the webui?

Linux

Custom settings

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@unsatisfying unsatisfying added the bug Something isn't working label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant