py2exe problems

Discussion in 'Python' started by Alessandro Crugnola *sephiroth*, Aug 7, 2003.

  1. Hi,
    i'm trying to compile a .py script using py2exe into a win .exe file.
    In that script i'm using xml.dom.minidom to parse an xml file (with the iso8859-1 encoding)

    i've included in the setup command line the --packages encodings
    but once i launch the exe file i receive this error in the console window:

    Traceback (most recent call last):
    File "<string>", line 51, in Notify
    File "<string>", line 105, in __init__
    File "WindowsSnippets.pyc", line 27, in __init__
    File "WindowsSnippets.pyc", line 135, in loadXML
    File "xml\dom\minidom.pyc", line 1915, in parse
    File "xml\dom\expatbuilder.pyc", line 924, in parse
    File "xml\dom\expatbuilder.pyc", line 207, in parseFile
    LookupError: no codec search functions registered: can't find encoding

    how can i solve the issue?
    Mayn thanks

    --

    Alessandro Crugnola
     
    Alessandro Crugnola *sephiroth*, Aug 7, 2003
    #1
    1. Advertising

  2. "Alessandro Crugnola *sephiroth*" <> writes:

    > Hi,
    > i'm trying to compile a .py script using py2exe into a win .exe file.
    > In that script i'm using xml.dom.minidom to parse an xml file (with the iso8859-1 encoding)
    >
    > i've included in the setup command line the --packages encodings
    > but once i launch the exe file i receive this error in the console window:
    >
    > Traceback (most recent call last):
    > File "<string>", line 51, in Notify
    > File "<string>", line 105, in __init__
    > File "WindowsSnippets.pyc", line 27, in __init__
    > File "WindowsSnippets.pyc", line 135, in loadXML
    > File "xml\dom\minidom.pyc", line 1915, in parse
    > File "xml\dom\expatbuilder.pyc", line 924, in parse
    > File "xml\dom\expatbuilder.pyc", line 207, in parseFile
    > LookupError: no codec search functions registered: can't find encoding
    >
    > how can i solve the issue?


    Which Python version are you using? 2.3 doesn't yet work correctly, but
    2.2 should be ok.

    Thomas
     
    Thomas Heller, Aug 7, 2003
    #2
    1. Advertising

  3. > Which Python version are you using? 2.3 doesn't yet work correctly, but
    > 2.2 should be ok.


    thanks for the quick reply..
    i'm currently usng python 2.3 in fact..
    I will try to get back to 2.2 and let you know

    --

    Alessandro Crugnola [sephiroth]
    Flash | PHP Developer
    http://www.sephiroth.it
     
    Alessandro Crugnola *sephiroth*, Aug 7, 2003
    #3
  4. i'm sorry, but it gives me the same warning also using python 2.2.3

    --

    Alessandro Crugnola [sephiroth]
    Flash | PHP Developer
    http://www.sephiroth.it

    Team Macromedia Volunteer for Flash
    http://www.macromedia.com/go/team

    Flash-php mailing list
    http://www.flash-php.it/index.php?ml=fpcoders&action=subscribe

    "Alessandro Crugnola *sephiroth*" <> ha scritto nel messaggio news:xGsYa.28339$...
    > > Which Python version are you using? 2.3 doesn't yet work correctly, but
    > > 2.2 should be ok.

    >
    > thanks for the quick reply..
    > i'm currently usng python 2.3 in fact..
    > I will try to get back to 2.2 and let you know
    >
    > --
    >
    > Alessandro Crugnola [sephiroth]
    > Flash | PHP Developer
    > http://www.sephiroth.it
    >
    >
     
    Alessandro Crugnola *sephiroth*, Aug 7, 2003
    #4
  5. "Alessandro Crugnola *sephiroth*" <> writes:

    > i'm sorry, but it gives me the same warning also using python 2.2.3


    The canonical test I use is to run the test_c14n.py test from the
    PyXML source distribution through py2exe. It works for me, on Windows XP
    Pro, SP 1, py2exe-0.4.1, Python 2.2.2, PyXML-0.8.3, with the command line
    'python setup.py py2exe p encodings'
    and this script:

    from distutils.core import setup
    import py2exe

    setup(name='test_c14n', scripts=['test_c14n.py'], version='0')

    If I don't include the '-p encodings' flag, the exe fails with this error:

    C:\PyXML-0.8.3\test\dist\test_c14n>test_c14n
    Traceback (most recent call last):
    File "<string>", line 170, in ?
    File "imputil.pyc", line 132, in _import_hook
    File "<string>", line 70, in _finish_import
    File "imputil.pyc", line 316, in _load_tail
    File "imputil.pyc", line 271, in _import_one
    File "<string>", line 128, in _process_result
    File "xml\dom\ext\reader\__init__.pyc", line 20, in ?
    LookupError: unknown encoding: utf-8

    Can you try this and report back?

    Thanks,

    Thomas

    PS: With Python 2.3 and py2exe-0.4.1, the traceback is this (even if -p
    encodings had been given), note the different error message:

    C:\PyXML-0.8.3\test\dist\test_c14n>test_c14n
    Traceback (most recent call last):
    File "<string>", line 170, in ?
    File "imputil.pyc", line 132, in _import_hook
    File "<string>", line 70, in _finish_import
    File "imputil.pyc", line 316, in _load_tail
    File "imputil.pyc", line 271, in _import_one
    File "<string>", line 128, in _process_result
    File "xml\dom\ext\reader\__init__.pyc", line 20, in ?
    LookupError: no codec search functions registered: can't find encoding
     
    Thomas Heller, Aug 7, 2003
    #5
  6. > The canonical test I use is to run the test_c14n.py test from the
    > PyXML source distribution through py2exe. It works for me, on Windows XP
    > Pro, SP 1, py2exe-0.4.1, Python 2.2.2, PyXML-0.8.3, with the command line
    > 'python setup.py py2exe p encodings'
    > and this script:
    >
    > from distutils.core import setup
    > import py2exe
    >
    > setup(name='test_c14n', scripts=['test_c14n.py'], version='0')


    Sorry, i get always the same error:

    File "<string>", line 170, in ?
    File "imputil.pyc", line 132, in _import_hook
    File "<string>", line 70, in _finish_import
    File "imputil.pyc", line 316, in _load_tail
    File "imputil.pyc", line 271, in _import_one
    File "<string>", line 128, in _process_result
    File "xml\dom\ext\reader\__init__.pyc", line 20, in ?
    LookupError: no codec search functions registered: can't find encoding


    python 2.2.3
    pyxml 0.8.3


    --

    Alessandro Crugnola [sephiroth]
    Flash | PHP Developer
    http://www.sephiroth.it

    Team Macromedia Volunteer for Flash
    http://www.macromedia.com/go/team

    Flash-php mailing list
    http://www.flash-php.it/index.php?ml=fpcoders&action=subscribe
     
    Alessandro Crugnola *sephiroth*, Aug 7, 2003
    #6
  7. "Alessandro Crugnola *sephiroth*" <> writes:

    >> The canonical test I use is to run the test_c14n.py test from the
    >> PyXML source distribution through py2exe. It works for me, on Windows XP
    >> Pro, SP 1, py2exe-0.4.1, Python 2.2.2, PyXML-0.8.3, with the command line
    >> 'python setup.py py2exe -p encodings'
    >> and this script:
    >>
    >> from distutils.core import setup
    >> import py2exe
    >>
    >> setup(name='test_c14n', scripts=['test_c14n.py'], version='0')

    >
    > Sorry, i get always the same error:
    >
    > File "<string>", line 170, in ?
    > File "imputil.pyc", line 132, in _import_hook
    > File "<string>", line 70, in _finish_import
    > File "imputil.pyc", line 316, in _load_tail
    > File "imputil.pyc", line 271, in _import_one
    > File "<string>", line 128, in _process_result
    > File "xml\dom\ext\reader\__init__.pyc", line 20, in ?
    > LookupError: no codec search functions registered: can't find encoding
    >
    >
    > python 2.2.3
    > pyxml 0.8.3


    Then I have no idea. Installing 2.2.3 instead of 2.2.2 is something I
    cannot currently do (and I doubt it would help).

    Thomas
     
    Thomas Heller, Aug 7, 2003
    #7
  8. Alessandro Crugnola *sephiroth*, Aug 7, 2003
    #8
  9. "Alessandro Crugnola *sephiroth*" <> writes:

    > i've installed python 2.2.2 and now it seems working well.
    > Excuse, me but what are the issues with the other python versions?


    So, there is a workaround for you, at least.

    Sigh, in this case I should also install 2.2.3 and look into this.
    The problem with 2.3 is that some imports seem to happen very early,
    when the interpreter is initialized. And the py2exe import hook is
    installed later, but it seems too late for warnings and encodings, at
    least. Thanks for finding this.

    Thomas
     
    Thomas Heller, Aug 7, 2003
    #9
  10. > Sigh, in this case I should also install 2.2.3 and look into this.
    > The problem with 2.3 is that some imports seem to happen very early,
    > when the interpreter is initialized. And the py2exe import hook is
    > installed later, but it seems too late for warnings and encodings, at
    > least. Thanks for finding this.


    thanks to you for the script!

    --

    Alessandro Crugnola [sephiroth]
    Flash | PHP Developer
    http://www.sephiroth.it

    Team Macromedia Volunteer for Flash
    http://www.macromedia.com/go/team

    Flash-php mailing list
    http://www.flash-php.it/index.php?ml=fpcoders&action=subscribe
     
    Alessandro Crugnola *sephiroth*, Aug 7, 2003
    #10
  11. Thomas Heller <> writes:

    > "Alessandro Crugnola *sephiroth*" <> writes:
    >
    >>> The canonical test I use is to run the test_c14n.py test from the
    >>> PyXML source distribution through py2exe. It works for me, on Windows XP
    >>> Pro, SP 1, py2exe-0.4.1, Python 2.2.2, PyXML-0.8.3, with the command line
    >>> 'python setup.py py2exe -p encodings'
    >>> and this script:
    >>>
    >>> from distutils.core import setup
    >>> import py2exe
    >>>
    >>> setup(name='test_c14n', scripts=['test_c14n.py'], version='0')

    >>
    >> Sorry, i get always the same error:
    >>
    >> File "<string>", line 170, in ?
    >> File "imputil.pyc", line 132, in _import_hook
    >> File "<string>", line 70, in _finish_import
    >> File "imputil.pyc", line 316, in _load_tail
    >> File "imputil.pyc", line 271, in _import_one
    >> File "<string>", line 128, in _process_result
    >> File "xml\dom\ext\reader\__init__.pyc", line 20, in ?
    >> LookupError: no codec search functions registered: can't find encoding
    >>
    >>
    >> python 2.2.3
    >> pyxml 0.8.3

    >
    > Then I have no idea. Installing 2.2.3 instead of 2.2.2 is something I
    > cannot currently do (and I doubt it would help).


    Ok, I've installed 2.2.3 and verified the behaviour you observed.
    And I have a workaround:

    run the setup script with these options, and the test_c14n.py script
    works as executable:

    python py2exe --packages encodings --force-imports encodings

    (I had nearly forgotten the force-imports option, and I still don't
    remember exactly what it does :)

    Thomas
     
    Thomas Heller, Aug 7, 2003
    #11
  12. > Ok, I've installed 2.2.3 and verified the behaviour you observed.
    > And I have a workaround:
    >
    > run the setup script with these options, and the test_c14n.py script
    > works as executable:
    >
    > python py2exe --packages encodings --force-imports encodings


    thank you, i'll try asap

    --

    Alessandro Crugnola [sephiroth]
    Flash | PHP Developer
    http://www.sephiroth.it

    Team Macromedia Volunteer for Flash
    http://www.macromedia.com/go/team
     
    Alessandro Crugnola *sephiroth*, Aug 7, 2003
    #12
  13. >>> File "<string>", line 170, in ?
    >>> File "imputil.pyc", line 132, in _import_hook
    >>> File "<string>", line 70, in _finish_import
    >>> File "imputil.pyc", line 316, in _load_tail
    >>> File "imputil.pyc", line 271, in _import_one
    >>> File "<string>", line 128, in _process_result
    >>> File "xml\dom\ext\reader\__init__.pyc", line 20, in ?
    >>> LookupError: no codec search functions registered: can't find encoding
    >>>
    >>>
    >>> python 2.2.3
    >>> pyxml 0.8.3

    >>


    > Ok, I've installed 2.2.3 and verified the behaviour you observed.
    > And I have a workaround:
    >
    > run the setup script with these options, and the test_c14n.py script
    > works as executable:
    >
    > python py2exe --packages encodings --force-imports encodings
    >


    This trick even helps with Python 2.3. I've added a comment to the web
    page.

    Thomas
     
    Thomas Heller, Aug 7, 2003
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jamie
    Replies:
    0
    Views:
    302
    Jamie
    Jul 7, 2003
  2. F. GEIGER
    Replies:
    0
    Views:
    918
    F. GEIGER
    Aug 16, 2004
  3. python
    Replies:
    3
    Views:
    1,797
    Simon Brunning
    May 22, 2006
  4. Chris Spencer

    Re: [Py2exe-users] py2exe 0.6.9 released

    Chris Spencer, Nov 17, 2008, in forum: Python
    Replies:
    3
    Views:
    572
    Pascal
    Dec 8, 2008
  5. Mark Hammond

    RE: [Py2exe-users] py2exe 0.6.9 released

    Mark Hammond, Nov 17, 2008, in forum: Python
    Replies:
    0
    Views:
    459
    Mark Hammond
    Nov 17, 2008
Loading...

Share This Page