Making a Stand Alone Executable from a Python Script using PyInstaller

packaging just isn't as hard as all that. here are some suggestions based on the way i often do things.


These compile-to-exe setups are such bullshit. There are lot of clean ways to do these kinds of things.

If you are doing this to hide your code, it doesn't hide your code so stop it. no one wants to copy your shit anyway - they don't have that kind of time.

Some possible options:

  1. If you just want an 'easy' way to run code as a .exe, setuptools supports entry points which do in fact generate .exe files that launch your scripts. I package icons and other resources with 'package data=' and i install shortcuts and icons and user level stuff with 'post_install()' and 'data_files=' with setuptools.

You could package an uninstall script with an entry point and make a registry entry so it shows up on installed programs if you wanted.

  1. Are you doing it to avoid installing python? Why? Java doesn't do this. Your installer should just check for an install of python and offer to install something like miniconda for them.

  2. Are you doing lots of crazy install stuff as system admin for some special project? you can use tools like openssh and fabric to do a lot of this and end it with the pip install command for your package. You did create a package right?

/r/Python Thread Link -