473,671 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.sele ctDir of <__main__.MainW indow
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.py c", line 129, in urlopen
None
File "urllib2.py c", line 326, in open
None
File "urllib2.py c", line 306, in _call_chain
None
File "urllib2.py c", line 901, in http_open
None
File "urllib2.py c", line 884, in do_open
None
File "httplib.py c", line 712, in endheaders
None
File "httplib.py c", line 597, in _send_output
None
File "httplib.py c", line 564, in send
None
File "httplib.py c", 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.urlretri eve(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\pyt hon setup.py py2exe -pPIL --packages=encodi ngs
Thanks
Mike

Jul 18 '05 #1
2 2633
(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******** *************** ***********@pyt hon.org...
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.sele ctDir of <__main__.MainW indow
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.py c", line 129, in urlopen
None
File "urllib2.py c", line 326, in open
None
File "urllib2.py c", line 306, in _call_chain
None
File "urllib2.py c", line 901, in http_open
None
File "urllib2.py c", line 884, in do_open
None
File "httplib.py c", line 712, in endheaders
None
File "httplib.py c", line 597, in _send_output
None
File "httplib.py c", line 564, in send
None
File "httplib.py c", 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.urlretri eve(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\pyt hon setup.py py2exe -pPIL --packages=encodi ngs
Thanks
Mike


Jul 18 '05 #2
this was my command line

c:\python23\pyt hon setup.py py2exe -pPIL --packages=encodi ngs

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******** *************** ***********@pyt hon.org...
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.sele ctDir of <__main__.MainW indow
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.py c", line 129, in urlopen
None
File "urllib2.py c", line 326, in open
None
File "urllib2.py c", line 306, in _call_chain
None
File "urllib2.py c", line 901, in http_open
None
File "urllib2.py c", line 884, in do_open
None
File "httplib.py c", line 712, in endheaders
None
File "httplib.py c", line 597, in _send_output
None
File "httplib.py c", line 564, in send
None
File "httplib.py c", 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.urlretri eve(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\pyt hon setup.py py2exe -pPIL --packages=encodi ngs
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
2983
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 "import numarray" allows the exe to run. Left in, I get "4.exe has generated errors" etc. I'm going around and around and there isn't much on Google. py2exe output is last.
1
2587
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 skillz</sarcasm>. Everything was going great I went and got all the newest software (including Distutils and PY2EXE) and read the docs on making a setup py.
5
2614
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 ############## (rgs.py is the real program.)
6
5816
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 name it works fine(commented example in the code), but if I pass in variables in this for loop it throws errors: --- The script: import csv, urllib
0
8476
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8393
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8917
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8598
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7437
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6229
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5696
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4225
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4407
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.