Including PYDs/DLLs in py2exe builds

前端 未结 4 1449
眼角桃花
眼角桃花 2021-01-17 16:52

One of the modules for my app uses functions from a .pyd file. There\'s an option to exclude dlls (exclude_dlls) but is there one for including them? The build process doesn

4条回答
  •  半阙折子戏
    2021-01-17 17:50

    Maybe you could use the data_files option to setup():

    import glob
    setup(name='MyApp',
          # other options,
          data_files=[('.', glob.glob('*.dll')),
                      ('.', glob.glob('*.pyd'))],
         )
    

    data_files should be a list of tuples, where each tuple contains:

    1. The target directory.
    2. A list of files to copy.

    This won't put the files into library.zip, which shouldn't be a problem for dlls, but I don't know about pyd files.

提交回复
热议问题