I have a python script I need to be able to run on a computer not having Python installed on it.
I do have found a compile.py example on this link: Can I somehow "compile" a python script to work on PC without Python installed?
When running it as "python compile.py python_script.py" in command prompt, it seems to work, but py2exe seems to compile everything in Python; language-packages etc. This in turn makes the output directories very, very large, when all I really want is an .exe-file. It also takes a very long time to compile.
The script I am using just imports pandas, datetime and a few other packages.
Is the compiler supposed to take that much time and space? Is there another, easier way than explained in the link above?
Thanks
-
Well, that's just the way things work. py2exe should make sure to only include the used modules, but there's a limit to this. Basically you ship a whole python interpreter, including you own source. And you can't have this within a single executable either. If you want that, use a language like C++.deets– deets2014年10月20日 14:27:09 +00:00Commented Oct 20, 2014 at 14:27
1 Answer 1
I would recommend using pyinstaller. There's an option for an .exe only. In terms of size, it'll be just as large, but will only be the single exe.