Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python executables without python installed on target PC

I have heard, that Python programs can be "converted" into executables files. My question are:

  1. Will that executable work on PC, where is not installed python?
  2. Will that executable work on PC, where are not installed all libraries, which I installed manually with pip for "development"?
  3. If answer to previous questions is YES, then - will running my executable firstly install python and used library?

Thanks!

like image 737
Petr Marek Avatar asked Apr 19 '26 04:04

Petr Marek


1 Answers

Will that executable work on PC, where is not installed python?

Yes

Will that executable work on PC, where are not installed all libraries, which I installed manually with pip for "development"?

Yes

If answer to previous questions is YES, then - will running my executable firstly install python and used library?

No need to install python just run newly created .exe on windows machine by copy paste on it.

Yes you can do it using pyinstaller. On your machine do run

pip install pyinstaller
pyinstaller --onefile -w 'filename.py'

This will create ‘dist’ folder above. Here you will get your ‘.exe’ file.

Ref:
https://www.geeksforgeeks.org/convert-python-script-to-exe-file/
like image 128
Ishwar Chincholkar Avatar answered Apr 27 '26 03:04

Ishwar Chincholkar