Skip to content Skip to sidebar Skip to footer

Python Cx_freeze Egg Problem

im trying to build an executable (for 32bit windows xp) from a python script (which uses lots of eggs) i considered py2exe(0.6.9), PyInstaller (1.4) and cx_Freeze (4.1.2) py2exe do

Solution 1:

Unpack your eggs module in your source directory and add package: [dependencies,] in your setup.py. Following the py2exe docs in py2Exe Docs i did this script that you most run in your source executing: python unpackEgg.py eggsmodule:

    import os
    import pkg_resources
    import sys
    from setuptools.archive_util import unpack_archive

    def unpackEgg(modulo):
        eggs = pkg_resources.require(modulo)
        for egg in eggs:
            if os.path.isdir(egg.location):
                sys.path.insert(0, egg.location)
                continue
            unpack_archive(egg.location, ".")
        eggpacks = set()
        eggspth = open("./eggs.pth", "w")
        for egg in eggs:
            print egg
            eggspth.write(os.path.basename(egg.location))
            eggspth.write("\n")
            eggpacks.update(egg.get_metadata_lines("top_level.txt"))
        eggspth.close()

        eggpacks.clear()


    if __name__ == '__main__':
    unpackEgg(sys.argv[1])

Solution 2:

You could try PyInstaller's 2.6 branch that is linked in the page you gave.

Post a Comment for "Python Cx_freeze Egg Problem"