I want to make a portable app that would have some code and python executable that would run on any Windows even if python is not installed.
I would like it to be python 3.6 and so it has only pip
and setup tools
installed.
EDIT: concerning duplicate
not quite. I don't want to compile the code. I wanted to give them .py
files but realize that Windows won't have python installed on default. I want something that can be carry on a flash drive but will run my code from source not binary.
In theory, Python is a portable language. You can write your script locally and distribute it to other machines with the Python interpreter. In practice, things can go wrong for a variety of reasons. The first and simpler problem is the module system: for a script to run, all of the modules it uses must be installed.
Yes, you literally download the installer from python.org and select the installation folder you want. This folder may very well be on a USB drive. You can also install PyCharm on your drive - and now you have a fully featured portable development environment.
Please correct me, if I understood it wrong. I think there are at least two ways to do it. suppose you have one portable_run.py script you want to run everywhere on a flashdisk.
Make a exe file with pyinstaller for example. you can get a exe file like portable_run.exe. On target windows system what you need to do is to run the exe direcltly protable_run.exe
Use a portable python distribution like winpython or python-xy. you just need to copy this portable distribution on the flash disk together with your portable_run.py. To run it on target system flashdisk/path-of-winpython/python portable_run.py
Hopefully it could give you some idea.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With