-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Naming Conflict: datumaro.py Causes ModuleNotFoundError #8026
Comments
Hi. Thank you for reporting the problem. Could you add more information about the script? Is it a custom script used outside of CVAT or a CVAT component? I can see other formats can import Datumaro package successfully. If it's a side script, maybe it's better to move it into some other location and copy the related dependencies with the names changed. |
Hello, The problem persists not only in my custom script Further Details: I have confirmed that the Suggested Approach: Request for Guidance: Your guidance on resolving this matter would be greatly appreciated. Thank you again for your assistance. Operating System: macOS Best regards |
If the script you're working on is not a part of CVAT, then you should keep in mind how module resolution works in Python. To resolve the problem, just move the script to some other place and copy the required dependencies with renaming, if necessary. https://docs.python.org/3/reference/import.html#namespace-packages |
The Given that this naming conflict impacts essential scripts, I am currently unable to proceed with adding support for a new annotation format. Your guidance on addressing this issue comprehensively would be invaluable in ensuring the stability and performance of the CVAT framework. Thank you for your prompt attention to this matter. |
Could you clarify the problem with YOLO? |
Actions before raising this issue
Steps to Reproduce
I encountered an issue while working with the CVAT repository. The file named
datumaro.py
in the directorycvat/cvat/apps/dataset_manager/formats
causes a naming conflict with thedatumaro
package installed in the virtual environment.This conflict results in a
ModuleNotFoundError
when attempting to import from thedatumaro
package, as Python imports the localdatumaro.py
file instead of the installed package.Steps to Reproduce:
datumaro
package.Dataset
fromdatumaro.components.project
in a script located incvat/cvat/apps/dataset_manager/formats
.Expected Behavior
Expected Outcome:
The script importTest.py should execute without errors, successfully importing Dataset from datumaro.components.project.
Actual Outcome:
from datumaro.components.dataset import Dataset ModuleNotFoundError: No module named 'datumaro.components'; 'datumaro' is not a package
Possible Solution
Proposed Solution:
Rename the local
datumaro.py
file to avoid conflicts, e.g., todatumaro_local.py
.However, I'm aware that renaming files might have implications elsewhere in the codebase. Could you please confirm if this change would be acceptable, or suggest an alternative solution?
Context
Additional Information:
I have verified that the issue is not related to a general import problem because the script runs without errors when executed from outside the CVAT repository directory.
Environment
No response
The text was updated successfully, but these errors were encountered: