-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Retrying pyinstaller. Insanity is trying the same thing over and over…
… and expecting different results.
- Loading branch information
1 parent
df77190
commit cb11885
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
""" | ||
Can never get pyisntaller to work | ||
""" | ||
|
||
import PyInstaller.__main__ | ||
import platform | ||
import os | ||
|
||
def build(): | ||
# Path to your main application script | ||
app_script = os.path.join('app', 'app.py') | ||
print(f'app_script:{app_script}') | ||
|
||
# Common PyInstaller options | ||
pyinstaller_options = [ | ||
'--clean', | ||
'--noconfirm', | ||
'--debug=all', | ||
'--onefile', | ||
'--paths=./venv/lib/python3.9/site-packages', | ||
'--paths=/usr/local/lib/python3.9/site-packages', | ||
'--hidden-import=pyautogui', | ||
'--hidden-import=openai', | ||
'--hidden-import=appdirs', | ||
'--hidden-import=pyparsing', | ||
'--hidden-import=pyaudio', | ||
'--hidden-import=speech_recognition', | ||
# '--windowed', # Remove this if your application is a console program | ||
'--name=Open Interface', | ||
'--add-data=app/resources/icon.png:img', | ||
'--add-data=app/resources/microphone.png:img', | ||
'--add-data=app/resources/context.txt:data', | ||
'--add-data=app/core.py:.', | ||
'--add-data=app/interpreter.py:.', | ||
'--add-data=app/llm.py:.', | ||
'--add-data=app/ui.py:.', | ||
'--add-data=app/utils/settings.py:utils', | ||
'--add-data=app/utils/screen.py:utils', | ||
'--add-data=app/utils/local_info.py:utils', | ||
app_script | ||
] | ||
|
||
""" | ||
# Platform-specific options | ||
if platform.system() == 'Windows': | ||
pyinstaller_options.extend([ | ||
'--onefile', # Uncomment this if you want a single executable file | ||
# '--icon=someicon.ico' # Path to an icon file for the Windows executable | ||
]) | ||
elif platform.system() == 'Darwin': # macOS | ||
pyinstaller_options.extend([ | ||
'--onefile', # Uncomment this if you want a single executable file | ||
# '--icon=someicon.icns' # Path to an icon file for the macOS executable | ||
]) | ||
elif platform.system() == 'Linux': | ||
pyinstaller_options.extend([ | ||
'--onefile', # Uncomment this if you want a single executable file | ||
# Additional Linux-specific options here | ||
]) | ||
""" | ||
|
||
# Run PyInstaller with the specified options | ||
#PyInstaller.__main__.run(['-v']) | ||
print("\n") | ||
PyInstaller.__main__.run(pyinstaller_options) | ||
|
||
|
||
if __name__ == "__main__": | ||
build() |