imageio / imageio-ffmpeg

FFMPEG wrapper for Python
BSD 2-Clause "Simplified" License
225 stars 50 forks source link

use pkg_resources to get binary #8

Closed paulmueller closed 5 years ago

paulmueller commented 5 years ago

I removed LIB_DIR, because it is not used anywhere. I add bin_dir in the function, because it triggers an extraction of the binary (if applicable) and should not happen when importing the module. For instance, people might want to use their own exes anyway and not want to wait for pkg_resources to extract another one.

closes #7

almarklein commented 5 years ago

Awesome! Out of curiosity, how does this work with PyInstaller? Does it place the binary relative to the root application directory and have pkg_resources point at it?

paulmueller commented 5 years ago

Yes, the binary is placed in root/imageio_ffmpeg/binaries and root apparently is the first location where the frozen app looks for libraries (In that sense, it would also work without pkg_resources. However, I don't know whether __file__ is well-defined for frozen apps and therefore pkg_resources is definitely the cleaner solution).