Py2Exe PROBLEM

L

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
 
P

Peter Hansen

Lad said:
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
 
L

Lad

Peter Hansen said:
Lad said:
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
 
D

David Fraser

Lad said:
Peter Hansen said:
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
 
P

Peter Hansen

Lad said:
Peter Hansen said:
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:

(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
 
L

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,202
Messages
2,571,058
Members
47,668
Latest member
SamiraShac

Latest Threads

Top