0

I have this setup.py script for incorporating icon for my .exe file, but the icon isnt appearing after the setup. the icon is 361 KB in size.

from distutils.core import setup
import py2exe

setup(
    console = [
        {
            "script": "wykoRas_parser.py",                    ### Main Python script    
            "icon_resources": [(0, "bw-gears.ico")]     ### Icon to embed into the PE file.
        }
    ],
) 

Am i missing something from the setup?

ellabells
  • 49
  • 3
  • 10

2 Answers2

1
from distutils.core import setup

setup(
    options = {'py2exe': {'bundle_files': 1}},
    zipfile = None,
    windows = [{
            "script":"myprogram.pyw",
            "icon_resources": [(1, "myicon.ico")],
            "dest_base":"myprogram"
            }],
)

Could you try this one please, I had some problem before these codes solved.

  • @ellabells I don't know what methods doing in `setup`, it's just solved my problem before. –  Jan 09 '15 at 02:37
  • An error? How, it worked for me before. Which Python version do you using? –  Jan 09 '15 at 02:39
  • i added import py2exe and it compiled, the problem is there's no icon and the .exe file isnt running, im using 2.7.3 – ellabells Jan 09 '15 at 02:41
  • @ellabells The problem about exe file isn't running, probably about your program not setup. I think your icon is have problems, could you try another icons? And check your main script again, if exe isn't running then something wrong in your main script. –  Jan 09 '15 at 02:48
  • the main script is working fine without the additional code from the icon. My icon is now 1KB in size and 16x16 pix @importV – ellabells Jan 09 '15 at 02:59
0

I was having the same issue, apparently is an old bug that hasn't been fixed. I found a workaround though.

This solved the issue for me, look for Ronan Paixão answer

Community
  • 1
  • 1
munoz
  • 65
  • 1
  • 6