472,374 Members | 1,290 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

py2exe and urllib(2) errors

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
2 2553
(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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: RJS | last post by:
Hi all, I can't get a py2exe compiled app to run with numarray (numarray-0.5.win32- py2.2). Also wxPythonWIN32-2.3.3.1-Py22 and ActivePython-2.2.1-222. In the sample below, commenting out...
1
by: Funduk | last post by:
Hello, So I've been playing with Python and Pygame for a while and I decided I wanted to make a real executable so I could send that stuff over to my friends to show off my <sarcasm>maad...
5
by: Lad | last post by:
I try to make an exe file from my script with help of Py2exe but I am not successfull. I have my script start.py that has only one command ############### import rgs.py ############## ...
6
by: justsee | last post by:
Hi, I'm using Python 2.3 on Windows for the first time, and am doing something wrong in using urllib to retrieve images from urls embedded in a csv file. If I explicitly specify a url and image...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

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.