Skip to content

Accessing the python environment after freeze #5978

Answered by rokm
tawjaw asked this question in Help
Discussion options

You must be logged in to vote

Is there a way to run the QProcess Python command using the frozen python environment?

Not unless you have a python environment installed on the target system.

If you wanted to (re)use the embedded python interpreter that PyInstaller uses to run your frozen script, you would need to spawn the process (with QProcess) using sys.executable, and design your entry-point script to handle special command-line argument that signals that you want it to run the script from given file instead of the main frozen application (for example, implement optional --run-script file.py argument). Then load the provided file and execute the code using exec. Of course, all modules that could be used by such e…

Replies: 2 comments 15 replies

Comment options

You must be logged in to vote
9 replies
@rokm
Comment options

@tawjaw
Comment options

@rokm
Comment options

@sreekarreddy21
Comment options

@bwoodsend
Comment options

Answer selected by tawjaw
Comment options

You must be logged in to vote
6 replies
@xzhacker123
Comment options

@rokm
Comment options

@xzhacker123
Comment options

@rokm
Comment options

@xzhacker123
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
5 participants