Now I copy PyQt5.uic into addon directory’s Lib and then import it
from .Lib.PyQt5 import uic uic.loadUi('C:/Users/Xavier/AppData/Roaming/Anki2/addons21/draft/ui/main.ui', self.mainWindow)
- I have tried
uic.loadUi('ui/main.ui', self.mainWindow), but they all failed.
Is there any way to use relative path rathen than absolute path?
- For loading .ui file, I use uic, and so need PyQ5-tools, which is provided by Anki itself, so I need copy PyQt5 to project-root-dir/Lib, and then import using .Lib.PyQt5.
is there a module provided by Anki itself which can make me use it to load .ui file without install a module into my project directory’s Lib folder?
Thanks a lot.