Python Forum
Adding libraries to embedded Python as a ZIP - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Adding libraries to embedded Python as a ZIP (/thread-39930.html)



Adding libraries to embedded Python as a ZIP - The_Oman - May-05-2023

Python 3.8.10 for Windows x64

We have been using the base embedded Python 3.8 with success. We now need to add some additional libraries to the installation to allow for some more advanced capabilities. Several of the libraries have a substantial number of files, so we we would like to package them similarly to the way that the base embedded Python is installed, using a ZIP file.

Some of the libraries make use of PYD files (DLLs). We are aware of the fact that Windows cannot load a PYD file from a ZIP file. The base embedded install includes the PYD files outside of the ZIP file that uses them, in the same directory that contains the Python.dll file itself.

We would like to use that same method for the additional libraries, however all attempts to make that work have failed. It appears that the PYD loading system does not use the any of the PATH systems that Python normally uses for finding files. We have not found how we can modify the installed package to load the PYD file from anywhere but the same location as the Python file that loads it.

Does anyone know of a method that we can use to allow for the library to search for, or hard code a different path for the required PYDs? How is the embedded system built so that it can load the required PYD files from the same place as the ZIP file?

Thanks!




My problem ce