In PyDev, whenever there is an error in a line, you can press Ctrl + 1, and it will show the ability to ignore this warning in this line (in this case, it will add a comment: # @UnusedImport - which you can add manually - in this line and that the error / warning will be ignored).
Now, for a better strategy for you (so you don't have to import this module everywhere): in Python, when you import a package, parents will be imported earlier.
i.e:.
/my_project /my_project/__init__.py /my_project/submodule.py /my_project/package /my_project/package/__init__.py
When importing my_project.submodule or my_project.package, you will first need to import (and execute) the code in /my_project/__init__.py
So, the best strategy for you would be just adding this import to /my_project/__init__.py (and whenever any submodule is imported, the registrars will already be configured).
It just doesn't work if you have a collection of files that are scattered in the root directory of PYTHONPATH, and in a file that you execute as your __main__ (since it will not import this file, it will simply receive its contents and execute it - but any time that this file imports something from / my _project, everything will be installed).
source share