You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dependencies in requirements.txt have module conflicts.
Description
There are two dependencies mentioned in the requirements.txt file: faiss-cpu and faiss-gpu. Based on my knowledge, these two packages have module conflicts.
This is mainly because when packages are installed using pip, they are by default installed in the site-packages directory without any isolation between different packages. This means that when both faiss-cpu and faiss-gpu are installed, both of them having the same module name ‘faiss’, they would both be installed in the faiss folder. Therefore, modules present in both packages would conflict and get overridden (with the later installed module overriding the earlier one, depending on the installation order and dependency declaration order). This behavior is the default for pip and there are no warnings.
If the contents of the overridden files are the same, there won’t be any problems. But if the contents of these files differ, conflicts may arise. There could potentially be functional errors present. For instance, certain functions require the invocation of the faiss-cpu's module, but faiss-gpu overrides the faiss-cpu's module. As a result, the Python interpreter mistakenly identifies the faiss-gpu's module as the faiss-cpu's module, leading to some functional errors.
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.
The text was updated successfully, but these errors were encountered:
Background
Dependencies in
requirements.txt
have module conflicts.Description
There are two dependencies mentioned in the
requirements.txt
file:faiss-cpu
andfaiss-gpu
. Based on my knowledge, these two packages have module conflicts.This is mainly because when packages are installed using pip, they are by default installed in the
site-packages
directory without any isolation between different packages. This means that when bothfaiss-cpu
andfaiss-gpu
are installed, both of them having the same module name ‘faiss’, they would both be installed in thefaiss
folder. Therefore, modules present in both packages would conflict and get overridden (with the later installed module overriding the earlier one, depending on the installation order and dependency declaration order). This behavior is the default for pip and there are no warnings.If the contents of the overridden files are the same, there won’t be any problems. But if the contents of these files differ, conflicts may arise. There could potentially be functional errors present. For instance, certain functions require the invocation of the
faiss-cpu
's module, butfaiss-gpu
overrides thefaiss-cpu
's module. As a result, the Python interpreter mistakenly identifies thefaiss-gpu
's module as thefaiss-cpu
's module, leading to some functional errors.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.
The text was updated successfully, but these errors were encountered: