473,236 Members | 1,292 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,236 software developers and data experts.

Py2Exe PROBLEM

Lad
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.)

I use the following setup script:
#################################
from distutils.core import setup
import py2exe

setup(
# The first three parameters are not required, if at least a
# 'version' is given, then a versioninfo resource is built from
# them and added to the executables.
version = "0.5.0",
description = "py2exe sample script",
name = "py2exe samples",

# targets to build
windows = ["start.py"],
console=["start.py"]
)
###########################
When compilation finishes I get:

The following modules appear to be missing
['blackbox', 'timing', 'rgs.py']

Can you please help me how to solve the problem?
Thank you
LAd
Jul 18 '05 #1
5 2582
Lad wrote:
I try to make an exe file from my script with help of Py2exe but I am
not successfull. .... When compilation finishes I get:

The following modules appear to be missing
['blackbox', 'timing', 'rgs.py']

Can you please help me how to solve the problem?


If you explain what problem you are actually having.

Are you assuming simply because of that warning message that
it didn't work? What happens when you try to run the resulting
..exe file?

Note that py2exe will sometimes complain about modules that
are not actually required for the program to run.

Also please explain what "blackbox" and "timing" are, if
they are part of the problem.

Finally (and this might be the whole problem), you seem
to be using "import rgs.py" when you really meant to use
just "import rgs". You don't import Python modules using
the full filename of the source file...

-Peter
Jul 18 '05 #2
Lad
Peter Hansen <pe***@engcorp.com> wrote in message news:<2t********************@powergate.ca>...
Lad wrote:
I try to make an exe file from my script with help of Py2exe but I am
not successfull.

...
When compilation finishes I get:

The following modules appear to be missing
['blackbox', 'timing', 'rgs.py']

Can you please help me how to solve the problem?


If you explain what problem you are actually having.

Are you assuming simply because of that warning message that
it didn't work? What happens when you try to run the resulting
.exe file?

Note that py2exe will sometimes complain about modules that
are not actually required for the program to run.

Also please explain what "blackbox" and "timing" are, if
they are part of the problem.

Finally (and this might be the whole problem), you seem
to be using "import rgs.py" when you really meant to use
just "import rgs". You don't import Python modules using
the full filename of the source file...

-Peter


Dear Peter,
Thank you for your help.
Yes, I changed import rgs.py to import rgs but I still receive
The following modules appear to be missing
['blackbox', 'timing', 'rgs.py']


When I try to start the exe file I get

Traceback (most recent call last):
File "rgs.pyc", line 561, in OnFileHistory

File "pickle.pyc", line 1390, in load
File "pickle.pyc", line 872, in load
File "pickle.pyc", line 985, in load_string
LookupError: unknown encoding: string-escape

Can you please help again?
Lad
Jul 18 '05 #3
Lad wrote:
Peter Hansen <pe***@engcorp.com> wrote in message news:<2t********************@powergate.ca>...
Also please explain what "blackbox" and "timing" are, if
they are part of the problem.
Yes, I changed import rgs.py to import rgs but I still receive
>>The following modules appear to be missing['blackbox', 'timing', 'rgs.py']
Again, what are "blackbox" and "timing"? Just two modules
which rgs.py imports, or something else entirely?
When I try to start the exe file I get

Traceback (most recent call last):
File "rgs.pyc", line 561, in OnFileHistory

File "pickle.pyc", line 1390, in load
File "pickle.pyc", line 872, in load
File "pickle.pyc", line 985, in load_string
LookupError: unknown encoding: string-escape

Can you please help again?


Somebody will generally help, whether me or others...

The above actually looks like you might not be using
the right version of something. Try running the same
version of python that you used to generate the py2exe'd
file and type the following in it:
r'tes\t'.decode('string-escape')


(Yes, just as I did there... complete with r and \t )

Does it give the same error? If it does, then you
probably don't have Python 2.3 installed...

In any case, if you can't figure it out, post the version
of Python and py2exe that you are using. Also make
sure you have fully tested the application *before* running
py2exe on it, so you'll know whether the problem involves
py2exe or not.

Note that based on what you are showing, there is now nothing
wrong with your py2exe setup: it generated a .exe and you
can run it. The fact that it is failing points to a different
problem, not py2exe.

-Peter
Jul 18 '05 #4
Lad wrote:
Peter Hansen <pe***@engcorp.com> wrote in message news:<2t********************@powergate.ca>...
Lad wrote:

I try to make an exe file from my script with help of Py2exe but I am
not successfull.


...
When compilation finishes I get:

The following modules appear to be missing
['blackbox', 'timing', 'rgs.py']

Can you please help me how to solve the problem?


If you explain what problem you are actually having.

Are you assuming simply because of that warning message that
it didn't work? What happens when you try to run the resulting
.exe file?

Note that py2exe will sometimes complain about modules that
are not actually required for the program to run.

Also please explain what "blackbox" and "timing" are, if
they are part of the problem.

Finally (and this might be the whole problem), you seem
to be using "import rgs.py" when you really meant to use
just "import rgs". You don't import Python modules using
the full filename of the source file...

-Peter

Dear Peter,
Thank you for your help.
Yes, I changed import rgs.py to import rgs but I still receive
>>The following modules appear to be missing['blackbox', 'timing', 'rgs.py']

When I try to start the exe file I get

Traceback (most recent call last):
File "rgs.pyc", line 561, in OnFileHistory

File "pickle.pyc", line 1390, in load
File "pickle.pyc", line 872, in load
File "pickle.pyc", line 985, in load_string
LookupError: unknown encoding: string-escape

Can you please help again?
Lad


You need to add "encodings" to the list of packages that you manually
include (the option is called packages I think) - see the py2exe wiki

David
Jul 18 '05 #5
Lad
> >
Dear Peter,
Thank you for your help.
Yes, I changed import rgs.py to import rgs but I still receive
>>The following modules appear to be missing['blackbox', 'timing', 'rgs.py']

When I try to start the exe file I get

Traceback (most recent call last):
File "rgs.pyc", line 561, in OnFileHistory

File "pickle.pyc", line 1390, in load
File "pickle.pyc", line 872, in load
File "pickle.pyc", line 985, in load_string
LookupError: unknown encoding: string-escape

Can you please help again?
Lad


You need to add "encodings" to the list of packages that you manually
include (the option is called packages I think) - see the py2exe wiki

David


Thank you Peter and David for your time to help.
Now the script starts but still it does not run as good as under
Python.
In fact it gets stuck( hangs) and I do not know exactly where.Is there
a method how to find out where it hanged?

In my program I import the following modules:

from _winreg import *
from wxPython.wx import *
import locale,base64,urllib2,shutil,os.path,timeoutsocket ,fnmatch,zipfile,thread,random,mimetools,threading ,urllib,string,urlparse,httplib,
re,os,webbrowser,time,strptime,glob,pickle,smtplib ,nntplib,ConfigParser,sys

Is there any known problem with any of those moduls running with
Py2exe?
I use
PythonWin 2.3.4 (#53, May 25 2004)
WxPython 2.4.1.2
Thanks
Lad.
Jul 18 '05 #6

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...
2
by: Stefan Behrens | last post by:
Hi, does anybody know how I can get py2exe to work with wxPython's wxCalendarCtrl? Currently, I have just a "standard" setup.py, and py2exe gives me a syntax error. Do I need to include any...
0
by: Kathleen Kudzma | last post by:
I'm having a problem with py2exe for Python 2.3. I got fixed the Lookuperror no codec search functions registered: can't find encoding by following the instructions on the py2exe page (added...
8
by: Kathleen Kudzma | last post by:
Does anyone know how to resolve the following problem that I'm getting in Python 2.2 and 2.3? PROBLEM: When I try to create a classReader object I get an exception: "SAXReaderNotAvailable: No...
5
by: Rene Olsthoorn | last post by:
Dear readers, py2exe has a problem including libxml2. Not at building time, but at runtime. The libxml2.dll cannot be loaded... Is there anyone that NOT has the problem? (and can you drop me...
6
by: Luc Saffre | last post by:
Hello, I had a strange problem when freezing (using either py2exe or McMillan installer) a script that imports reportlab (which imports PIL (which imports FixTk))). - Python 2.3.3c (also with...
2
by: Kylotan | last post by:
I need to be able to build Py2Exe from the source code as I am making a Windows executable where I wish to preprocess the modules before importing them.It looks like I can do this by adding lines...
4
by: bwaha | last post by:
First time trying to create an executable with py2exe. I have a small program which makes use of python23 (2.3.5?), wxpython ('2.6.2.1'), matplotlib ('0.83.2'), win32com (latest?), Numeric...
1
by: Dave Lim | last post by:
>On May 3, 1:29 pm, Dave Lim <diband... at yahoo.com> wrote: site:http://surguy.net/articles/speechrecognition.xml used out tried ? to protection aroundhttp://mail.yahoo.com I went and
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.