r/pythonhelp • u/skahaggus • Jan 09 '23
Running Python reliably on a Windows computer without installing Python
This is probably going to sound a little convoluted, but this might be a solution to a problem I'm encountering with Python software I'm creating and distributing at work...
I'm wondering...instead of creating an executable or installing Python using its normal installer file, I thought maybe I could manually copy over the Python interpreter and associated files, including the Lib and the Scripts folder. The interpreter and associated files will already be configured properly (e.g., any needed libraries will already be installed).
On this computer, I want to create a batch file for the user to run my code. (It'd just point to the Python interpreter and to the Python code I've written.)
I tested this and it seems to work...I know this probably sounds like a needlessly complicated process, but it may be simpler than my alternatives.
Is this likely to work reliably, or are there problems I'm going to encounter here that I haven't thought of?
Thanks!
1
u/Zeroflops Jan 09 '23
Better to just creat a py exe file which does all this in one executable file. Pyinstaller is one option but there are others.
An alternative would be to make your app web based and serve it from a common location.