Accessing Pyinstaller bootloaded environment from spawned process #8318
Replies: 2 comments
-
Hmm, this whole bootloaded environment is a construct you've made up I'm afraid. A PyInstaller application is not a relocatable Python environment so no, it does not contain a |
Beta Was this translation helpful? Give feedback.
-
As Brénainn already pointed out, PyInstaller-frozen application uses embedded python interpreter to run your application code, so you cannot use it from the outside of the application process.
This is up to OS to decide, not the application (i.e., contemporary versions of Windows allow you to globally switch between Windows Terminal and old |
Beta Was this translation helpful? Give feedback.
-
Thanks for all your work on this excellent installer.
We are trying to package a python application which spawns a terminal emulator (wezterm) and runs python from within it. The reason we are doing this is because we use textual for a terminal-based GUI, and not all terminals render correctly (e.g.
cmd.exe
).Fundamentally my question is: How can a terminal spawned in a subprocess inherit the bootloaded environment such that commands in the terminal (e.g.
python
) work as expected.A MRE is below, run simply within
pyinstaller run_app.py
(and then, for now, manually copying the folder_vendored
containing thewezterm
executable).I was hoping based on this part of the documentation that when spawning a new terminal, it might inherit the bootloaded environment. Unfortunately this does not seem to be the case, for example executing
python
(or versioned variants of) is not recognised, similar to a terminal when opened in the usual windows environment through the windows GUI.In this case, maybe it is necessary to perform these steps that pyinstaller performs in a new process (from this doc) to setup the environment?:
Alternatively, it would be awesome if it was possible to specify which console is used by pyinstaller when the
--console
flag is set toTrue
. Then we could run our python code directly in a terminal we know can supporttextual
.MRE:
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions