By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,273 Members | 1,037 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,273 IT Pros & Developers. It's quick & easy.

py2exe and urllib(2) errors

P: n/a
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 method MainWindow.selectDir of <__main__.MainWindow
instance
at 0x00DF4058>> (type: <type 'instancemethod'>)
Args: ()
Traceback (innermost last):
File "Pmw.pyc", line 1784, in __call__
None
File "<string>", line 270, in selectDir
None
File "<string>", line 361, in grabAlbumDirs
None
File "<string>", line 431, in addAlbumData
None
File "<string>", line 469, in grabImage
None
File "urllib2.pyc", line 129, in urlopen
None
File "urllib2.pyc", line 326, in open
None
File "urllib2.pyc", line 306, in _call_chain
None
File "urllib2.pyc", line 901, in http_open
None
File "urllib2.pyc", line 884, in do_open
None
File "httplib.pyc", line 712, in endheaders
None
File "httplib.pyc", line 597, in _send_output
None
File "httplib.pyc", line 564, in send
None
File "httplib.pyc", line 532, in connect
None
LookupError: no codec search functions registered: can't find encoding
Here is the section of code that produces the error

urllib.urlretrieve(imageURL, saveFile)

imageURL and saveFile are correct
Here is my setup.py file

# setup.py
from distutils.core import setup

import py2exe

setup(
scripts=["art.py"]
)
and here is my batch file

c:\python23\python setup.py py2exe -pPIL --packages=encodings
Thanks
Mike

Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
(From the py2exe homepage:
http://starship.python.net/crew/theller/py2exe/)
...if your exe-file reports errors like LookupError: no codec search
functions registered: can't find encoding or LookupError: unknown encoding,
you should advise py2exe to include this package with the '--packages
encodings' command line option.

Google turns up information very quickly.

Larry Bates
"Mike Zupan" <mi**@zcentric.com> wrote in message
news:ma**********************************@python.o rg...
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 method MainWindow.selectDir of <__main__.MainWindow
instance
at 0x00DF4058>> (type: <type 'instancemethod'>)
Args: ()
Traceback (innermost last):
File "Pmw.pyc", line 1784, in __call__
None
File "<string>", line 270, in selectDir
None
File "<string>", line 361, in grabAlbumDirs
None
File "<string>", line 431, in addAlbumData
None
File "<string>", line 469, in grabImage
None
File "urllib2.pyc", line 129, in urlopen
None
File "urllib2.pyc", line 326, in open
None
File "urllib2.pyc", line 306, in _call_chain
None
File "urllib2.pyc", line 901, in http_open
None
File "urllib2.pyc", line 884, in do_open
None
File "httplib.pyc", line 712, in endheaders
None
File "httplib.pyc", line 597, in _send_output
None
File "httplib.pyc", line 564, in send
None
File "httplib.pyc", line 532, in connect
None
LookupError: no codec search functions registered: can't find encoding
Here is the section of code that produces the error

urllib.urlretrieve(imageURL, saveFile)

imageURL and saveFile are correct
Here is my setup.py file

# setup.py
from distutils.core import setup

import py2exe

setup(
scripts=["art.py"]
)
and here is my batch file

c:\python23\python setup.py py2exe -pPIL --packages=encodings
Thanks
Mike


Jul 18 '05 #2

P: n/a
this was my command line

c:\python23\python setup.py py2exe -pPIL --packages=encodings

it was using py2exe 4.2. I also tried with no = to get the same results

Mike
(From the py2exe homepage:
http://starship.python.net/crew/theller/py2exe/)
..if your exe-file reports errors like LookupError: no codec search
functions registered: can't find encoding or LookupError: unknown
encoding, you should advise py2exe to include this package with the
'--packages encodings' command line option.

Google turns up information very quickly.

Larry Bates
"Mike Zupan" <mi**@zcentric.com> wrote in message
news:ma**********************************@python.o rg...
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 method MainWindow.selectDir of <__main__.MainWindow
instance
at 0x00DF4058>> (type: <type 'instancemethod'>)
Args: ()
Traceback (innermost last):
File "Pmw.pyc", line 1784, in __call__
None
File "<string>", line 270, in selectDir
None
File "<string>", line 361, in grabAlbumDirs
None
File "<string>", line 431, in addAlbumData
None
File "<string>", line 469, in grabImage
None
File "urllib2.pyc", line 129, in urlopen
None
File "urllib2.pyc", line 326, in open
None
File "urllib2.pyc", line 306, in _call_chain
None
File "urllib2.pyc", line 901, in http_open
None
File "urllib2.pyc", line 884, in do_open
None
File "httplib.pyc", line 712, in endheaders
None
File "httplib.pyc", line 597, in _send_output
None
File "httplib.pyc", line 564, in send
None
File "httplib.pyc", line 532, in connect
None
LookupError: no codec search functions registered: can't find encoding
Here is the section of code that produces the error

urllib.urlretrieve(imageURL, saveFile)

imageURL and saveFile are correct
Here is my setup.py file

# setup.py
from distutils.core import setup

import py2exe

setup(
scripts=["art.py"]
)
and here is my batch file

c:\python23\python setup.py py2exe -pPIL --packages=encodings
Thanks
Mike


--
http://mail.python.org/mailman/listinfo/python-list



Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.