#16
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2006
    Posts
    1
    Rep Power
    0
    Originally Posted by wx_uab
    ...
    3 . File "Image.pyc", line 1571, in open
    IOError: cannot identify image file

    Solution : In order to make PIL and PY2EXE work together all libraries of PIL need to be imported explicitly such as:

    import Image
    import BmpImagePlugin # if you are using bitmaps
    Import JpgImagePlugin # if you are dealing with jpg images

    So forth ..
    Note : These explicit imports may not be necessary if you are running the python script directly but are needed if you are running the exe file created by py2exe .
    i tried to use this solution but it didn't work for me
    i am using python 2.4 with PIL 1.15
    i use reportlab 1.20 in connection with PIL to generate PDF-Files this works fine
    but if i try to put my script into an executable with help of py2exe, i can't use images anymore.
    if i generate PDFs without images it works fine.
    but when i try to use images i get this error:

    Code:
    File "PIL\Image.pyc", line 1745, in open
    IOError: cannot identify image file
    as you can see there are about 200 lines more now in comparism to your error. and the file has moved to the subdir "PIL" -> "PIL\Images.pyc" instead of only "Image.pyc" in root dir

    i hope you can help me
  2. #17
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2006
    Posts
    16
    Rep Power
    0
    im following the instructions, but i get this error when i try to run the exe file

    Traceback (most recent call last):
    File "asl-alphabet.py", line 2, in ?
    File "letters.pyc", line 1, in ?
    File "hand.pyc", line 1, in ?
    File "dmsgl.pyc", line 23, in ?
    File "OpenGL\__init__.pyc", line 18, in ?
    File "OpenGL\__init__.pyc", line 14, in __set_attributes
    IOError: [Errno 2] No such file or directory: 'C:\\Documents and Settings\\Sunny
    Chan.PDPXPIT\\Desktop\\Web Server\\ASL\\dist\\library.zip\\OpenGL\\version'
  4. #18
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2006
    Posts
    16
    Rep Power
    0
    never mind, i figured it out

    Comments on this post

    • pabloj disagrees : Either delete or post your findings, please
    • netytan disagrees : Please post how you fixed the problem so others can learn from it :).
  6. #19
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Posts
    1
    Rep Power
    0

    help pls


    i did a game in python using pygame
    when i tried to convert to exe by py2exe its getting converted and the exe files are created. but when i click on the exe file it throws the following error

    Traceback (most recent call last):
    File "foot.py", line 390, in ?
    File "foot.py", line 167, in main
    File "foot.py", line 17, in load_sound
    pygame.error: Mix_LoadWAV_RW with NULL src

    pls help me
  8. #20
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2006
    Posts
    8
    Rep Power
    0
    Well I am using Python 2.5 and PY2EXE.py is not a file in it. Python 2.2 (which I was previously using) had py2exe but gave an error saying to use build_exe.py.

    Python 2.5 does have a build_exe.py though. any hints? Should I use the same directions and switch the words py2exe with build_exe?

    EDIT: Nevermind... >.> I feel stupid now. I got it to work...
  10. #21
  11. Jeenyus
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2007
    Location
    New Jersey
    Posts
    92
    Rep Power
    21
    Not sure if this has been asked yet, but is there a PY2EXE equivelant for Linux to compile a Python program into a linux binary file?
  12. #22
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2005
    Posts
    12
    Rep Power
    0
    Excellent guide. Worked like a charm on the first try.
    Thanks Grim!!
  14. #23
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Posts
    1
    Rep Power
    0
    Hi! I'm using openGL and received a similar message then yours.
    How did you solve this problem?

    Thanks in advanced,

    -Error message --
    Traceback (most recent call last):

    File "main.py", line 11, in <module>

    File "mainwindow.pyo", line 6, in <module>

    File "ui_mainwindow.pyo", line 78, in <module>

    File "glwidget.pyo", line 8, in <module>

    File "OpenGL\__init__.pyo", line 18, in <module>

    File "OpenGL\__init__.pyo", line 14, in __set_attributes

    IOError: [Errno 2] No such file or directory: 'C:\\COPPE\\teste_distrib\\dist\\library.zip\\OpenGL\\version'
  16. #24
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Posts
    1
    Rep Power
    0
    I have a problem about doing the exe for my program, I try everything, installing PIL and doing the respectives imports

    but I still gettin this message, when I try to run the exe file:

    Traceback (most recent call last):
    gobject.GError: Couldn't recognize the image file format for file 'iconos/all/ber_icon.png'

    this is the function that I am using


    set_icon_from_file

    I try adding in the setup.py:


    import py2exe
    import Image
    import PngImagePlugin


    but nothing could fix that error...please help me I need to do a exe file...as soon as posible
  18. #25
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Posts
    47
    Rep Power
    0

    Having trouble with py2exe


    Hello all. I am a new coder to python. I used the step by step guide above to install py2exe. I have python 2.5, so I downloaded py2exe-0.6.6.win32-py2.5. I saved it to c:\py2exe folder. I made a new folder c:\mycode and one on the desktop when that one didnt work. I made the files and copied to code. when I try to run it from either desktop of C drive I get windows cannot find file blah blah blah form command console. I dont know whats up. Anyone got any ideas.
    Thanks,
    Your friendly neighborhood CodeSnorter

    EDIT: When I tried opened notepad and saved the file as text first, then renamed it, windows could not find the file. When I opened notepad, saved the code, then saved the file as hello.py, instead of renaming it it worked perfectly. Thanks
    Last edited by CodeSnorter; June 11th, 2008 at 02:20 PM. Reason: Fixed my own problem
  20. #26
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2007
    Posts
    9
    Rep Power
    0
    i'm having a problem compiling wx.lib.iewin. py2exe hangs when it trys to find this file and its dependencies. py2exe compiles older versions of iewin ok, but i need the latest version of wxpython
  22. #27
  23. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    May 2004
    Posts
    3,417
    Rep Power
    890
    The py2exe step by step guide link no longer points to a useful page. This thread is a mess and mostly doesn't warrant sticky status any longer. Is there no one to clean house around here?
    I no longer wish to be associated with this site.
  24. #28
  25. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2009
    Location
    Motor City
    Posts
    6
    Rep Power
    0
    It's almost funny... this has the potential to be a very useful program, but is beyond out dated. I am working on debugging it and updating it for python 3.1, but any help I could get would be greatly appreciated.

    ...if you get it all done before I do, feel free to post a version.

    -Bohden
  26. #29
  27. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    635
    Rep Power
    68
    Wish you good luck!

    Rumor has it that development on py2exe has stopped.
    cx_freeze is similar to py2exe and works on Windows and Unix. There is a version for Python3 at:
    http://cx-freeze.sourceforge.net/
    Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25
  28. #30
  29. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2010
    Posts
    5
    Rep Power
    0

    Unhappy Help modifying an open source program


    Hello, Am trying to modify an open source program written in Python. I am totally new to Python and just have a little programming knowledge of javascript, PHP & HTML. I am trying to add a function to the program and I would really appreciate assistance on this the program name is PICALO. I have installed python and wxPhthon and I tried running one of the codes using IDLE (Python GUI) but its giving an error. There might be something am not doing right.

IMN logo majestic logo threadwatch logo seochat tools logo