Does this PYD file have dependencies – be them other PYDs, DLLs or Python
libraries? This should be as simple as adding the parent directory to
sys.path and running import sd so if there’s no dependencies at play here,
I’d be surprised if you hadn’t got that working. The fact that you’re
getting a DLL load failed error instead of a ModuleNotFoundError would also
imply that your PYD is findable but not loadable.

I have tried manually setting the PATH and PYTHONPATH in the console and
even copying the .pyd file to be alongside the .exe itself, but nothing
works. Now the weird part. If I re-run the pyInstaller build with my
PYTHONPATH set to the location where my .pyd file resides, it creates an
executable that *does* work. So it appears that pyInstaller has its own
notion of a PYTHONPATH that can be augmented at build time but not runtime??

This also suggests the same. I think PyInstaller sees that import sd,
includes the PYD then runs it through its binary dependency analysis where
it discovers whatever DLLs this PYD is linked against and collects them.

P.S. That __get_run_path() path function is redundant. You should use
os.path.abspath(os.path.dirname(__file__)) unconditionally – adjusting any
--add-data arguments so that the files are put where the code now expects
them to be.

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/CAFLMo5_7902feJewJ2Tuntq6LDyjxTdgPPCcopqRemF_J4Y_OQ%40mail.gmail.com.

Reply via email to