Using a site-packages path for pyinstaller

  pyinstaller, python, windows

Im creating a pyinstaller spec file and need to add a DLL found in a library. This is right now in my own directory here:

e.g..

a = Analysis(['eyecommand.py'],
         pathex=['.'],
         binaries=["C:userswwadeappdatalocalprogramspythonpython39libsite-packagespyvjoyutilsx64vJoyInterface.dll"],
         datas=added_files,
         hiddenimports=["skimage.filters.rank.core_cy_3d","pynput.keyboard._win32", "pynput.mouse._win32"],
         hookspath=[],
         runtime_hooks=[],
         excludes=[],
         win_no_prefer_redirects=False,
         win_private_assemblies=False,
         cipher=block_cipher,
         noarchive=True)
         

The problem is I don’t want to commit that binary line – it will break on anyone else’s machine. Is there a way I can "generically" point to the site-packages dir?

e.g.

%SITEPACKAGES%pyvjoyutilsx64vJoyInterface.dll

??

Source: Windows Questions

LEAVE A COMMENT