Cx-Freeze Error - Python 34

2019-03-18 13:35发布

问题:

I have a Cx_Freeze setup file that I am trying to make work. What is terribly frustrating is that it used to Freeze appropriately. Now, however, I get the following error:

edit. the error that shows up is not a Python exception through the console, but a crash report when attempting to launch the resulting exe file generated through the freeze.

'File 'notetest.py', line 1, in _find_and_load importlib_bootstrap.py, line 2214

....

AttributeError 'module' object has no attribute '_fix_up_module'

My setup.py file follows:

    import sys
import os
from cx_Freeze import setup, Executable

build_exe_options = {'packages': [], 'excludes' : []}
base = 'Win32GUI'
exe = Executable(
    script = 'notetest.py',
    initScript = None,
    base = 'Win32GUI',
    targetName = 'MedicaidAid.exe',
    compress = True,
    appendScriptToExe = True,
    appendScriptToLibrary = True,
    icon = None
)

setup( name = 'MedicaidAid', 
        version = '0.85',
        description = 'MedicaidAid Software',
        options = {'build_exe': build_exe_options},
        executables = [Executable('notetest.py', base = base)])

回答1:

You should install cx_freeze from this site. It contains an important patch that solves the problem (see this discussion for detailed).



回答2:

Apparently this is a known issue with Cx_Freeze. BitBucket.

Apparently there is a compiling error that occurs. The bitbucket link lists the work-arounds.



回答3:

I had the same issue and the solution by Northcat worked just perfectly. The issue of missing patch in the other cx_freeze came into picture while installing(some alert messages were thrown) it. It is this missing patch because of which the alerts were given. The new installation from this link had no such alerts while installing and it so worked fine.