If you want to put all these files together, you gonna have to tell PyInstaller
to include them, lets do that by creating a spec
file.
First we generate it
pyinstaller --name=my_script my_script.py
then we modify our my_script.spec
so that for the a = Analysis()
we have something like the code below, modify the paths as needed.
a = Analysis(['my_script.py'],
pathex=['path\\to\\your\\script'],
binaries=[],
datas=[
('C:\\Users\\hchap\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\mediapipe\\python\\solutions\\*.*', 'mediapipe\\python\\solutions'),
# Add any other necessary directories here.
],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
then we can rebuild our application with our spec
file
pyinstaller my_script.spec
Now the resulting executable have the necessary MediaPipe
files bundled with it.