
Thanks - that was part of the solution, but it wasn't working with just that. Just in case someone else needs to get this working, turns out I also had to modify
sys.meta_path.
This is what I saw it as when Calibre is running. I guess the third entry in that list causes it to prioritize the built-in "frozen" libraries?:
Code:
sys.meta_path: [
<calibre.constants.DeVendor object at 0x000002128A2AA3A0>,
<__main__.PydImporter object at 0x000002128A22C310>,
BypyFrozenImporter with data in C:\Program Files\Calibre2\app\bin,
<class '_frozen_importlib.BuiltinImporter'>,
<class '_frozen_importlib.FrozenImporter'>,
<class '_frozen_importlib_external.PathFinder'>,
<calibre.constants.ExtensionsImporter object at 0x000002128A2B11F0>
]
To get it working quickly, in addition to modifying
sys.path to have
css-parser/src listed first before all imports using that module, I just did this in
constants.py after the
DeVendor() and
ExtensionsImporter() are added:
Code:
sys.meta_path.insert(0, sys.meta_path[5])
I daresay there's probably a more elegant solution to this, but there you are.