I’d like to bundle my PySide6 application and all its dependencies into a package using PyInstaller.
I have a SubProcessWorker in which I have a command:
command=“absolute_path_to_venv\python.exe script.py”
I suspect that I should replace my absolute hardcoded path to python with more flexible solution, am I right (different users have different paths)? If so, what is the proper solution in this case?
Since my python sits in the virtual environment I changed the code to: command="my_hardcoded_absolute_path_to_venv/python dummy_script.py",
so it could work.
Now I would like to bundle this application into a package using PyInstaller.
I assume that after bundling, my application won’t work on any users machine, because this is my hardcoded path to python exe.
If my assumption is right, what should I replace my hardcoded path with?
allow user to pass path to python interpreter, but it kill idea of pyinstaller itself, so user do not have to install python
make pyinstaller bundle from python dummy_script.py. with: pyinstaller.exe --no-console --onefile dummy_script.py and then use pyinstaller again with your main appliaction, but remember include dummy_script.exe add data/resource in pyinstaller spec file.