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

1
  • 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++. Commented Oct 20, 2014 at 14:27

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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 sourceforge.net/projects/pywin32
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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.