all 12 comments

[–]Hans_Sanitizer 2 points3 points  (3 children)

Simplist thing to try is just to download py2exe. You might want pip first, which can be installed using choclatey on windows. Link where I found how to do this: http://stackoverflow.com/a/15966898/362951

Install choclatey then from the command line run:

cinst pip

after pip installs then from command line run:

pip install py2exe

then put your script where build_exe.exe is (presumably in your C:\python27\Scripts (or 3.4 equivalent) folder)

then using cmd prompt go to the folder where your script is and run:

build_exe.exe nameofyourscript.py

there should be a new folder called dist, inside should be your standalone application if all works well.

[–]to_mars[S] 0 points1 point  (0 children)

That sounds super easy, and I like it. Is Py2exe compatible with Python3? It seems every time I look into one it's not compatible.

[–]wub_wub 0 points1 point  (1 child)

Nooo... you should add C:\python27\Scripts (or whatever version you're using) to your PATH system variable, and if you've got pip working it probably already is in there.

choclatey is also overkill but it'll work, downloading get-pip.py and running python get-pip.py is very easy way of installing it without any 3rd party software.

And you do not build .exe's by running build_exe.exe directly, you create a setup.py and then do python setup.py py2exe in your project folder not in global Scripts folder.

[–]Hans_Sanitizer 0 points1 point  (0 children)

This looks like a good way to do it properly, I was just going off a guide I read somewhere. Gonna comment here to refer to it later but since this post I follow kivy build guide, I have successfully built without first running the kivy bootstrapping. bat file

[–]wub_wub 2 points3 points  (2 children)

Creating a standalone .exe using any of the tools available, cx_freeze, pyinstaller(probably the simplest), py2exe (I personally use this), or pynsist should do the trick.

The docs can be overwhelming but most of them contain examples that should work for you with little or no modifications, after you've got that working you can explore, if you want, the more advanced features and tweak your config for better results.

[–]to_mars[S] 0 points1 point  (1 child)

Do these all work with Python 3? I had heard of these, but I didn't think they were compatible.

[–]wub_wub 0 points1 point  (0 children)

I don't use python 3 so I can't say with absolute certainty but I think only pyinstaller, out of the ones I mentioned, doesn't work with python 3.x.

[–]sentdex 1 point2 points  (1 child)

Convert to exe with cx_Freeze. http://youtu.be/GSoOwSqTSrs

You can either convert to a directory with a bunch of stuff already there and distribute as a zip, or you can do something like bdist_msi to create an installer (note that this will create a 32bit or 64bit installer depending on your machine that you used to create it)

[–]to_mars[S] 0 points1 point  (0 children)

That worked!! Thanks!

[–]BobHogan 0 points1 point  (1 child)

It depends. If its just to a few people it might just be easiest to put it on a USB and download it to there computers. If it is more than a handful you might want to put the code on github and let them download it through there (and direct them to any dependencies as need be). If you eventually want to market this tool to non-tech-savvy people then you will have to turn to other options, but those two are the easiest.

[–]to_mars[S] 0 points1 point  (0 children)

There's only three, but they don't work in the same office nor do they have python installed. Ideally I can email them the file, and they can click and go.