473,405 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

py2exe problems

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
Jul 18 '05 #1
12 5197
"Alessandro Crugnola *sephiroth*" <al********@sephiroth.it> 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
Jul 18 '05 #2
> 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
Jul 18 '05 #3
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...tion=subscribe

"Alessandro Crugnola *sephiroth*" <al********@sephiroth.it> ha scritto nel messaggio news:xG********************@news1.tin.it...
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

Jul 18 '05 #4
"Alessandro Crugnola *sephiroth*" <al********@sephiroth.it> 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
Jul 18 '05 #5
> 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...tion=subscribe
Jul 18 '05 #6
"Alessandro Crugnola *sephiroth*" <al********@sephiroth.it> 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
Jul 18 '05 #7
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?

--

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...tion=subscribe
Jul 18 '05 #8
"Alessandro Crugnola *sephiroth*" <al********@sephiroth.it> 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
Jul 18 '05 #9
> 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...tion=subscribe
Jul 18 '05 #10
Thomas Heller <th*****@python.net> writes:
"Alessandro Crugnola *sephiroth*" <al********@sephiroth.it> 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
Jul 18 '05 #11
> 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
Jul 18 '05 #12
>>> 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
Jul 18 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Brian Hlubocky | last post by:
I'm have a fairly simple (in terms of COM) python program that pulls info from an Access database and creates Outlook contacts from that information. It uses wxPython for gui and works without...
2
by: Mike Zupan | last post by:
I had some problems with urllib and py2exe under pyton2.3. I works fine until i try to use the exe file. Here is the error Error: 1 LookupError Exception in Tk callback Function: <bound...
0
by: Thomas Heller | last post by:
**py2exe 0.5.2** released ========================= py2exe is a Python distutils extension which converts python scripts into executable windows programs, able to run without requiring a python...
0
by: Jimmy Retzlaff | last post by:
py2exe 0.6.5 released ===================== py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python...
4
true911m
by: true911m | last post by:
Here's a little walkthrough to get py2exe up and running. I'm not an expert, so I can't help much with any problems you might have. This is what worked for me. The result here will be to convert...
0
by: Jimmy Retzlaff | last post by:
py2exe 0.6.6 released ===================== py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python...
5
by: Doug Morse | last post by:
Hi, I have an application that runs just fine using the standard Python distro interpreter (v2.5.1 on WinXP) but throws the following exception when run as an executable built with py2exe. My...
1
by: Jimmy Retzlaff | last post by:
py2exe 0.6.8 released ===================== py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python...
0
by: Larry Bates | last post by:
Jimmy Retzlaff wrote: Everyone, Thanks for all your hard work on py2exe, it is greatly appreciated. -Larry Bates
0
by: Jimmy Retzlaff | last post by:
py2exe 0.6.9 released ===================== py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.