Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


#33 cx_Freeze doesn't work with Python 3.3

Python 3.3 (1)
58 minutes ago

Application built with Python 3.3.0 and cx_freeze 4.3 doesn't work (crash before run). It does work with Python 3.2.3 + cx_freeze on Windows 7.

Traceback for simple "hello world" application from sample folder:

Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 1462, in _install
  File "<frozen importlib._bootstrap>", line 1454, in _setup
AttributeError: 'module' object has no attribute 'get_magic'
Fatal Python error: Py_Initialize: importlib install failed

Current thread 0x000017a0:

I think it is related to rewritten import machinery based on importlib in Python 3.3.0. It looks like build works fine.

running build
running build_exe
creating directory build\exe.win32-3.3
copying C:\Python33\lib\site-packages\cx_Freeze\bases\Console.exe -> build\exe.win32-3.3\hello.exe
copying C:\Windows\system32\python33.dll -> build\exe.win32-3.3\python33.dll
*** WARNING *** unable to create version resource
install pywin32 extensions first
writing zip file build\exe.win32-3.3\

  Name                      File
  ----                      ----
m BUILD_CONSTANTS           
m _bisect                   
m _bz2                      C:\Python33\DLLs\_bz2.pyd
m _codecs                   
m _codecs_cn                
m _codecs_hk                
m _codecs_iso2022           
m _codecs_jp                
m _codecs_kr                
m _codecs_tw                
m _collections              
m _datetime                 
m _dummy_thread             
m _functools                
m _heapq                    
m _imp                      
m _io                       
m _locale                   
m _multibytecodec           
m _string                   
m _strptime                 
m _struct                   
m _thread                   
m _threading_local          
m _warnings                 
m _weakref                  
m _weakrefset               
m abc                       
m argparse                  
m base64                    
m binascii                  
m bisect                    
m builtins                  
m bz2                       
m calendar                  
m codecs                    
P collections               
m contextlib                
m copy                      
m copyreg                   
m cx_Freeze__init__         C:\Python33\lib\site-packages\cx_Freeze\initscripts\
m datetime                  
m dummy_threading           
P encodings                 
m encodings.aliases         
m encodings.ascii           
m encodings.base64_codec    
m encodings.big5            
m encodings.big5hkscs       
m encodings.bz2_codec       
m encodings.charmap         
m encodings.cp037           
m encodings.cp1006          
m encodings.cp1026          
m encodings.cp1140          
m encodings.cp1250          
m encodings.cp1251          
m encodings.cp1252          
m encodings.cp1253          
m encodings.cp1254          
m encodings.cp1255          
m encodings.cp1256          
m encodings.cp1257          
m encodings.cp1258          
m encodings.cp424           
m encodings.cp437           
m encodings.cp500           
m encodings.cp65001         
m encodings.cp720           
m encodings.cp737           
m encodings.cp775           
m encodings.cp850           
m encodings.cp852           
m encodings.cp855           
m encodings.cp856           
m encodings.cp857           
m encodings.cp858           
m encodings.cp860           
m encodings.cp861           
m encodings.cp862           
m encodings.cp863           
m encodings.cp864           
m encodings.cp865           
m encodings.cp866           
m encodings.cp869           
m encodings.cp874           
m encodings.cp875           
m encodings.cp932           
m encodings.cp949           
m encodings.cp950           
m encodings.euc_jis_2004    
m encodings.euc_jisx0213    
m encodings.euc_jp          
m encodings.euc_kr          
m encodings.gb18030         
m encodings.gb2312          
m encodings.gbk             
m encodings.hex_codec       
m encodings.hp_roman8       
m encodings.hz              
m encodings.idna            
m encodings.iso2022_jp      
m encodings.iso2022_jp_1    
m encodings.iso2022_jp_2    
m encodings.iso2022_jp_2004 
m encodings.iso2022_jp_3    
m encodings.iso2022_jp_ext  
m encodings.iso2022_kr      
m encodings.iso8859_1       
m encodings.iso8859_10      
m encodings.iso8859_11      
m encodings.iso8859_13      
m encodings.iso8859_14      
m encodings.iso8859_15      
m encodings.iso8859_16      
m encodings.iso8859_2       
m encodings.iso8859_3       
m encodings.iso8859_4       
m encodings.iso8859_5       
m encodings.iso8859_6       
m encodings.iso8859_7       
m encodings.iso8859_8       
m encodings.iso8859_9       
m encodings.johab           
m encodings.koi8_r          
m encodings.koi8_u          
m encodings.latin_1         
m encodings.mac_arabic      
m encodings.mac_centeuro    
m encodings.mac_croatian    
m encodings.mac_cyrillic    
m encodings.mac_farsi       
m encodings.mac_greek       
m encodings.mac_iceland     
m encodings.mac_latin2      
m encodings.mac_roman       
m encodings.mac_romanian    
m encodings.mac_turkish     
m encodings.mbcs            
m encodings.palmos          
m encodings.ptcp154         
m encodings.punycode        
m encodings.quopri_codec    
m encodings.raw_unicode_escape 
m encodings.rot_13          
m encodings.shift_jis       
m encodings.shift_jis_2004  
m encodings.shift_jisx0213  
m encodings.tis_620         
m encodings.undefined       
m encodings.unicode_escape  
m encodings.unicode_internal 
m encodings.utf_16          
m encodings.utf_16_be       
m encodings.utf_16_le       
m encodings.utf_32          
m encodings.utf_32_be       
m encodings.utf_32_le       
m encodings.utf_7           
m encodings.utf_8           
m encodings.utf_8_sig       
m encodings.uu_codec        
m encodings.zlib_codec      
m errno                     
m functools                 
m genericpath               
m gettext                   
m heapq                     
m hello__main__   
m imp                       
P importlib                 
m importlib._bootstrap      
m importlib.machinery       
m io                        
m itertools                 
m keyword                   
m linecache                 
m locale                    
m math                      
m nt                        
m ntpath                    
m operator                  
m optparse                  
m os                        
m posixpath                 
m quopri                    
m reprlib                   
m stat                      
m string                    
m stringprep                
m struct                    
m sys                       
m textwrap                  
m threading                 
m time                      
m token                     
m tokenize                  
m traceback                 
m types                     
m unicodedata               C:\Python33\DLLs\unicodedata.pyd
m warnings                  
m weakref                   
m zipimport                 
m zlib                      

Missing modules:
? _frozen_importlib imported from importlib

copying C:\Python33\DLLs\_bz2.pyd -> build\exe.win32-3.3\_bz2.pyd
copying C:\Python33\DLLs\unicodedata.pyd -> build\exe.win32-3.3\unicodedata.pyd


  • Anonymous

    Same here!! I don't know how to deal with it.


  • Anonymous

    I have same problem with windows vista too


  • Anonymous

    Me too, please fix that guys.

    Keep up the great work :)

  • Python 3.3 on Windows changed the C runtime that it binds against. I did address this for the 3.3 beta but it may have been changed again for the final release. I'll take a look and make a new release shortly if that is indeed the case.

  • Andreb

    Any new infos about this? I have the same problem. Is there maybe a preliminary fix for this (besides using Python 3.2)?

    Last edit: Andreb 2012-10-16

  • Anonymous

    Same problem here.


  • Anonymous

    I have same problem - please fix that...


  • Anonymous

    Hello everybody. Any new info about this issue? I need the solution as soon as possible, too. Thanks a lot


  • Anonymous

    I would be very pleased to see this fixed, too. I have a python 3.3 application, that needs to be deployed on Windows.

    Thanks in Advance.


  • Anonymous

    I have the same problem :'(

  • Hi everyone. This is a problem with Python 3.3 on Windows only thanks to the change in the build environment. I am hoping to have this resolved soon -- but soon will likely be measured in a couple of weeks, not days as my time is limited, especially on a Windows machine. I thought I should update everyone so that they know I am working on it and I will post again when the matter is resolved.


    • Anonymous

      Thanks for the update!


  • Anonymous

    Thank you for the information.
    Good to know someone is working on it :)

  • li20034

    It happened to me too. Except it worked fine but when i ran the compiled exe, it hit an runtime error and crashes.


  • Anonymous

    Same issue, please fix it! =3


  • Anonymous

    Python 3.3 64bit, Win7 64Bit. Same Problem. Does it work on 32bit?

  • Ok. An update (finally). The importlib machinery was changed again for 3.3 final so I simply have to make a new release. For those who wish to try building on your own, you simply need to grab a copy of importlib.h from a source tarball and place it in the normal Python include directory. Im thinking there should be a better way of handling this but for now thats all there is. Now that I have gone this far I should be able to make a release later this week. Sorry for the delay. I really need to address this with the Python core development team and find out if I`m missing something obvious!

  • Ok. Another update. I have found a solution to the problem and have checked in the changes for those who wish to build from source directly using the Mercurial repository. For the rest I hope to make a release later this week. Thanks for your patience.


  • Anonymous

    Thank you for your effort! I would be glad, to see a release soon. :)


  • Anonymous

    First impression: 4.3.1 works fine with Python 3.3.0. Tested with PyQt on Windows 7 64-bit. Thank you for your effort!


  • Anonymous

    Hello Anthony,

    the new software version 4.3.1 works very good. Thank you.

    best regards


  • Anonymous

    Same problem here with python 3.3.2


  • Anonymous

    The problem is not fixed with the version 4.3.1 I can't compile my PyQt5 program it crash.


  • Anonymous

    I am having the same problem running Python 3.3.2, cx_Freeze 4.3.1, WinXP SP3


  • Anonymous

    I get the same error using Python 3.3.2, even when compiling a simple "hello world" script. Any world on a fix?


  • Anonymous

    Finally got cx_freeze to work with Python 3.3.2 and Windows 7. Strangely enough, this fixed everything... at the command line, type "Python install" then "Python build"



Cancel   Add attachments