1

I have been using pyinstaller to "spread" my codes into machines that don't have python 3.x installed, all within the same network. It is a great software, but even after reading the very extensive documentation, I am struggling to simplify the creation of .exe for this purpose.

Ideally, I would like to forward to the users just the .exe file (from the --onedir option, not --onefile as it would be huge). I have managed to create a runtime hook to search the dlls in the network:

ctypes.windll.kernel32.SetDllDirectoryW('W:\\Python\\dll')

except for the: VCRUNTIME140.dll, python37.dll and pywintypes37.dll. Which is very handy and saves a lot of space already. Nevertheless i have not managed to make the same for the .pyd files or the folders. I have tried setting the PATH at runtime to point at an external network folder, but that did not work either:

sys.path.append('W:\\Python\\pyd')

Another option I considered was to put all .pyd files into a zip folder (like the base_library.zip) and create a PATH to it. Didn't work either.

I am sure I am just missing something simple (or complex?). Perhaps browse the pyinstaller source code to change the folder there but I have tried to search it through some keywords to no avail.

I would like to emphasize that I am not trying to organize the files into nicer folder within the 'dist' folder, but search for the files in the network (it could be a previously pre-installed folder somewhere else in the machine where all different programs I create in python can share).

Has anyone had some experience with it and could point me in the right direction?

miliante
  • 11
  • 2

0 Answers0