From 6286cae9c79daeec479b6e92f2f9e74ebacf2fe2 Mon Sep 17 00:00:00 2001 From: SEBAS204 <36385457+ZEBAS204@users.noreply.github.com> Date: Wed, 18 Dec 2024 23:44:18 +0000 Subject: [PATCH] Use PyInstaller hooks to get missing packages --- TwitchFarm.spec | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/TwitchFarm.spec b/TwitchFarm.spec index 9e9ab89..70d07da 100644 --- a/TwitchFarm.spec +++ b/TwitchFarm.spec @@ -1,20 +1,25 @@ # -*- mode: python ; coding: utf-8 -*- import sysconfig +from PyInstaller.utils.hooks import get_package_paths block_cipher = None +def get_PKG(name, path): + # Assuming get_package_paths() is already defined elsewhere + return get_package_paths(name)[1] + path + added_files = [ ('settings.json', '.'), ('TwitchChannelPointsMiner/assets/*', 'assets'), # Dependencies - ('venv/Lib/site-packages/irc/*.txt', 'irc'), - ('venv/Lib/site-packages/emoji/unicode_codes/*.json', 'emoji/unicode_codes'), - ('venv/Lib/site-packages/dateutil/zoneinfo/*.tar.gz', 'dateutil\zoneinfo'), + (get_PKG('irc', '/*.txt'), 'irc'), + (get_PKG('emoji', '/unicode_codes/*.json'), 'emoji/unicode_codes'), + (get_PKG('dateutil', '/zoneinfo/*.tar.gz'), 'dateutil\zoneinfo'), ] a = Analysis(['TwitchFarm.py'], - pathex=['venv/Lib'], + pathex=[], binaries=[], datas=added_files, hiddenimports=[],