471,601 Members | 1,191 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,601 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 2510
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by RJS | last post: by
2 posts views Thread by Stefan Behrens | last post: by
reply views Thread by Kathleen Kudzma | last post: by
8 posts views Thread by Kathleen Kudzma | last post: by
5 posts views Thread by Rene Olsthoorn | last post: by
6 posts views Thread by Luc Saffre | last post: by
2 posts views Thread by Kylotan | last post: by
4 posts views Thread by bwaha | last post: by
1 post views Thread by Dave Lim | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by

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.