0

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

Community
  • 1
  • 1
gussilago
  • 922
  • 3
  • 12
  • 27
  • 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 Oct 20 '14 at 14:27

1 Answers1

2

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.

PointXIV
  • 1,258
  • 2
  • 15
  • 23
  • pyinstaller doesn't seem to work. It complains about me not having pywin32 installed, when I do have it installed! (via Anaconda). Have no clue how to go about this... Error: PyInstaller for Python 2.6+ on Windows needs pywin32. Please install from http://sourceforge.net/projects/pywin32/ – gussilago Oct 21 '14 at 09:20
  • Is your default python path set to anaconda? I've had similar problems before because of multiple installations of python (one normal, one anaconda, etc). – PointXIV Oct 21 '14 at 15:38