473,749 Members | 2,660 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 2636
(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
2991
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
2591
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
2619
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
5821
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
8833
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
9568
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...
0
9389
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8257
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
6801
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
6079
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
4709
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...
1
3320
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.