py2exe and disappeared icon
Question: I am using pyqt, icon is added.

    
    
    icon.addPixmap(QtGui.QPixmap(_fromUtf8("favicon.ico")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
    MainWindow.setWindowIcon(icon)
    

In setup.py for py2exe, I am trying to add my icon to resources.

    
    
    from distutils.core import setup 
    import py2exe 
    setup(
        console=[{
                "script" : "manage.py",
                "icon_resources": [(1, "favicon.ico")]
        }],
        options={
            "py2exe" : {"includes" : ["sip",]}
        }
    ) 
    

When I start my program from IDE as python script, I see my icon. When I
create exe program with py2exe, my program works well, but icon dissappears.


Answer: The problem is that py2exe doesn't include the qt icon reader plugin.
Data_files parameter added.

    
    
    from distutils.core import setup 
    import py2exe 
    setup(    
        options={
           "py2exe" : {"includes" : ["sip",]}
        },
        data_files = [
          ('imageformats', [
            r'C:\programs\Python271\Lib\site-packages\PyQt4\plugins\imageformats\qico4.dll'
            ])],
        console=[{          
           "script" : "manage.py"       
        }]
    ) 
    

