1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Albuquerque, New Mexico
    Rep Power

    Freezing Python?

    Is there a way to freeze a python script into a bin (on Linux) including all of the dependancies? I've heard of cx-freeze but, google didn't pull up anything interesting.
  2. #2
  3. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Cambridge, UK
    Rep Power
    Did you find this url:
    however, it is not a universal solution - you will need to do a package for each distro you will support. If you don't want to give out the source that will be difficult to maintain.

    A more universal solution is to distribute just the byte code (one package for each version of Python you will support). This is fine for Python/Tkinter and should be okay for wxPython.

    I built my own installer for Linux around some self extracting archive code but it might be better to use distutils bdist. There is a document on distributing using rpm in the Python Documentation
    Distributing Python Modules

    FYI this is what I did:
    Installed both Python 2.2 an 2.3
    For each version of Python...
    Created a distribution directory
    compiled the source code to .pyc files
    Deleted the .py files
    tarred the distribution directory
    joined the tar to a self extracting archive script.


IMN logo majestic logo threadwatch logo seochat tools logo