Tracking down the problem...

Werner F. Bruhin wrote:

Hi Virgil,

Please post to the list, either wxPython or for this it is probably better to use the py2exe list.

Virgil Stokes wrote:

Ok Werner,

I have tried to reproduce the configuration that you used in your setup.py file; i.e.,
I have moved msvcm90.dll, msvcp90.dll, msvcr90.dll, and Microsoft.VC90.CRT.manifest to the folder: c:\dev\Py26MSdlls.

I have attached the Microsoft.VC90.CRT.manifest (note, it does not contain any reference to the files msvcp90.dll, msvcn90.dll).

The one I used is naming them in the second to last line.

py2exe - wxPyWiki

But this is probably not your problem.

Have you copied the setup.py and the sample app I used for the above wiki.

Yes, exactly as the same!

Does this build for you?

No it does not build --- No folders/files are created!

Could you please explain the entry in data_files (in your setup.py file) --- "lib\Microsoft.VC90.CRT"
Here is what was stored in data_files after it was executed:

[('Microsoft.VC90.CRT', ['c:\\dev\\Py26MSdlls\\Microsoft.VC90.CRT.manifest', 'c:\\dev\\Py26MSdlls\\msvcr90.dll']), ('lib\\Microsoft.VC90.CRT', ['c:\\dev\\Py26MSdlls\\Microsoft.VC90.CRT.manifest', 'c:\\dev\\Py26MSdlls\\msvcr90.dll'])]

Also, I do not understand the use of "lib\library.zip" --- perhaps you can explain this briefly (the "lib" is what bothers me, as in data_files).

The way I use py2exe is to let it create a zip file with most of the stuff needed by the application, so instead of having about 90 folders and over 1,200 files which is used by my application I have one zip file.

But, what is the "lib" for?

It contains most of the modules/files of my application plus most of the library type stuff I use in my application (comtypes, ctypes, dateutil, distutils, email, encodings, kinterbasdb, matplotlib ......... etc etc).

A disadvantage is that one has to have two copies of the dll's, therefore the double entry in the data_files. Robin was going to look into if wxPython could be changed in a way that this second copy is not needed. I guess he has not had time or has not find a clean solution for this yet.

The following error is generated when I execute your setup.py file:

c:\Python26\lib\site-packages\py2exe\build_exe.py:16: DeprecationWarning: the sets module is deprecated
import sets

As previously mentioned this is just a "Warning" and does not affect the creation of the exe. The "sets" module is deprecated in 2.6 and I believe will be removed in Py3.0, but is being replace by some built in stuff - but the py2exe developers will have to change py2exe to correct this - as it is only a warning it is probably not very high on their list.

and no folders/files are created! Note, this is the only message that is generated.

I also verified that all the files given in dll_excludes are indeed on my Windows Vista system.

I am primarily on Vista and have created/tested the setup etc shown on the wiki on Vista and then run the generated application on XP, 2000, Win7 and Vista.

But, I get nothing except this warning message as the output from the build.

I hope that I am not overloading you with these emails --- if yes, just let me know. I really would like to be able to create *.exe files from *.py files on Python versions >= 2.6 on a Windows Vista platform. You seem to be one of the experts on this process and hopefully I can learn how to handle this myself without bothering you in the future. :slight_smile:

No problem, but just keep it on the list so it is in an archive and someone else having the same problem will find the answer we will eventually find to fix your problem.

--V

···

I suggest to do the following:
- copy the sample stuff I did on the above wiki to some folder on your machine and make that build - if it does not build in its current form I would like to hear what errors you get.
- when above works go back to your setup.py and make sure that it is equivalent to the one shown in the above wiki. When you get it working then you can start tweaking it the way you want to have - as what I show is definitely not the only way to do all this.

Werner

Virgil Stokes wrote:

Werner F. Bruhin wrote:

Hi Virgil,
Please post to the list, either wxPython or for this it is probably better to use the py2exe list.
Virgil Stokes wrote:

Ok Werner,
I have tried to reproduce the configuration that you used in your setup.py file; i.e.,
I have moved msvcm90.dll, msvcp90.dll, msvcr90.dll, and Microsoft.VC90.CRT.manifest to the folder: c:\dev\Py26MSdlls.
I have attached the Microsoft.VC90.CRT.manifest (note, it does not contain any reference to the files msvcp90.dll, msvcn90.dll).



The one I used is naming them in the second to last line.
But this is probably not your problem.
Have you copied the setup.py and the sample app I used for the above wiki.
Yes, exactly as the same!
Does this build for you?
No it does not build --- No folders/files are created!

Could you please explain the entry in data_files (in your setup.py file) --- "lib\Microsoft.VC90.CRT"
Here is what was stored in data_files after it was executed:
[('Microsoft.VC90.CRT', ['c:\\dev\\Py26MSdlls\\Microsoft.VC90.CRT.manifest', 'c:\\dev\\Py26MSdlls\\msvcr90.dll']), ('lib\\Microsoft.VC90.CRT', ['c:\\dev\\Py26MSdlls\\Microsoft.VC90.CRT.manifest', 'c:\\dev\\Py26MSdlls\\msvcr90.dll'])]
Also, I do not understand the use of "lib\library.zip" --- perhaps you can explain this briefly (the "lib" is what bothers me, as in data_files).
The way I use py2exe is to let it create a zip file with most of the stuff needed by the application, so instead of having about 90 folders and over 1,200 files which is used by my application I have one zip file.
But, what is the "lib" for?

It contains most of the modules/files of my application plus most of the library type stuff I use in my application (comtypes, ctypes, dateutil, distutils, email, encodings, kinterbasdb, matplotlib ......... etc etc).
A disadvantage is that one has to have two copies of the dll's, therefore the double entry in the data_files. Robin was going to look into if wxPython could be changed in a way that this second copy is not needed. I guess he has not had time or has not find a clean solution for this yet.

The following error is generated when I execute your setup.py file:
c:\Python26\lib\site-packages\py2exe\build_exe.py:16: DeprecationWarning: the sets module is deprecated
import sets
As previously mentioned this is just a "Warning" and does not affect the creation of the exe. The "sets" module is deprecated in 2.6 and I believe will be removed in Py3.0, but is being replace by some built in stuff - but the py2exe developers will have to change py2exe to correct this - as it is only a warning it is probably not very high on their list.

and no folders/files are created! Note, this is the only message that is generated.
I also verified that all the files given in dll_excludes are indeed on my Windows Vista system.
I am primarily on Vista and have created/tested the setup etc shown on the wiki on Vista and then run the generated application on XP, 2000, Win7 and Vista.
But, I get nothing except this warning message as the output from the build.
I hope that I am not overloading you with these emails --- if yes, just let me know. I really would like to be able to create *.exe files from *.py files on Python versions >= 2.6 on a Windows Vista platform. You seem to be one of the experts on this process and hopefully I can learn how to handle this myself without bothering you in the future. :-)
No problem, but just keep it on the list so it is in an archive and someone else having the same problem will find the answer we will eventually find to fix your problem.
--V

I suggest to do the following:
- copy the sample stuff I did on the above wiki to some folder on your machine and make that build - if it does not build in its current form I would like to hear what errors you get.
- when above works go back to your setup.py and make sure that it is equivalent to the one shown in the above wiki. When you get it working then you can start tweaking it the way you want to have - as what I show is definitely not the only way to do all this.
Werner

My directory structure for working on this problem is:

c:\dev\Py26MSdlls

which contains 4 files: Microsoft.VC90.CRT.manifest, msvcm90.dll, msvcp90.dll, msvcr90.dll.

I have setup.py and simplewx.py (both attached) in
c:\python26\Testing.

I have installed py2exe and wxPython for Python 2.6.

I still do not understand the use of “lib” in the setup.py
file??

–V

setup.py (3.93 KB)

simplewx.py (3.02 KB)

···

http://wiki.wxpython.org/py2exe

Virgil Stokes wrote:

Virgil Stokes wrote:

Have you copied the setup.py and the sample app I used for the above wiki.
Yes, exactly as the same!
Does this build for you?
No it does not build --- No folders/files are created!

I just copied the files you have attached to a folder and for me it
builds on:

dist folder content:

moz-screenshot-5.jpg

lib folder content:

the library.zip contains two folders and nearly 200 files.



But, what is the "lib" for?

It is a folder under “dist”, this way the base app folder contains very
few files.


My directory structure for working on this problem is:

c:\dev\Py26MSdlls

which contains 4 files: Microsoft.VC90.CRT.manifest, msvcm90.dll, msvcp90.dll, msvcr90.dll.

I have setup.py and simplewx.py (both attached) in
c:\python26\Testing.

I have installed py2exe and wxPython for Python 2.6.

I still do not understand the use of “lib” in the setup.py
file??
Very strange that this does not work for you, how are you running it?

I just run the files you attached from within Boa and it works fine.

I also tried it from a Vista command prompt like this:

C:\Dev\aaTests\virgil>\python26\python.exe setup.py py2exe

I get this output:

C:\python26\lib\site-packages\py2exe\build_exe.py:17:
DeprecationWarning: the sets module is deprecated

import sets

running py2exe

creating C:\Dev\aaTests\virgil\build

creating C:\Dev\aaTests\virgil\build\bdist.win32

creating C:\Dev\aaTests\virgil\build\bdist.win32\winexe

creating C:\Dev\aaTests\virgil\build\bdist.win32\winexe\collect-2.6

creating C:\Dev\aaTests\virgil\build\bdist.win32\winexe\bundle-2.6

creating C:\Dev\aaTests\virgil\build\bdist.win32\winexe\temp

creating C:\Dev\aaTests\virgil\dist

creating C:\Dev\aaTests\virgil\dist\lib

*** searching for required modules ***

copying c:\dev\Py26MSdlls\msvcr90.dll →
C:\Dev\aaTests\virgil\dist\lib\Microsoft.VC90.CRT

copying C:\python26\lib\site-packages\py2exe\run_w.exe →
C:\Dev\aaTests\virgil\dist\simplewx.exe

*** binary dependencies ***

Your executable(s) also depend on these dlls which are not included,

you may or may not need to distribute them.

Make sure you have the license if you distribute any of them, and

make sure you don’t distribute files belonging to the operating system.

OLEAUT32.dll - C:\Windows\system32\OLEAUT32.dll

USER32.dll - C:\Windows\system32\USER32.dll

SHELL32.dll - C:\Windows\system32\SHELL32.dll

KERNEL32.dll - C:\Windows\system32\KERNEL32.dll

COMDLG32.dll - C:\Windows\system32\COMDLG32.dll

WSOCK32.dll - C:\Windows\system32\WSOCK32.dll

MSVCP90.dll - C:\python26\MSVCP90.dll

COMCTL32.dll - C:\Windows\system32\COMCTL32.dll

ADVAPI32.dll - C:\Windows\system32\ADVAPI32.dll

GDI32.dll - C:\Windows\system32\GDI32.dll

WINMM.dll - C:\Windows\system32\WINMM.dll

ole32.dll - C:\Windows\system32\ole32.dll

gdiplus.dll -
C:\python26\lib\site-packages\wx-2.8-msw-unicode\wx\gdiplus.dll

RPCRT4.dll - C:\Windows\system32\RPCRT4.dll

Werner

Werner F. Bruhin wrote:

Virgil Stokes wrote:

Virgil Stokes wrote:

Have you copied the setup.py and the sample app I used for the above wiki.
Yes, exactly as the same!
Does this build for you?
No it does not build --- No folders/files are created!

I just copied the files you have attached to a folder and for me it
builds on:

dist folder content:

lib folder content:

the library.zip contains two folders and nearly 200 files.
Yes Werner, you are correct. I had made an error when completing the
last step.



But, what is the "lib" for?

It is a folder under “dist”, this way the base app folder contains very
few files.
Yes, this is true.


My
directory structure for working on this problem is:

c:\dev\Py26MSdlls

which contains 4 files: Microsoft.VC90.CRT.manifest, msvcm90.dll, msvcp90.dll, msvcr90.dll.

I have setup.py and simplewx.py (both attached) in
c:\python26\Testing.

I have installed py2exe and wxPython for Python 2.6.

I still do not understand the use of “lib” in the setup.py
file??
Very strange that this does not work for you, how are you running it?
Again, I had made a silly error at the end.

I just run the files you attached from within Boa and it works fine.

I also tried it from a Vista command prompt like this:

C:\Dev\aaTests\virgil>\python26\python.exe setup.py py2exe

I get this output:

C:\python26\lib\site-packages\py2exe\build_exe.py:17:
DeprecationWarning: the sets module is deprecated

import sets

running py2exe

creating C:\Dev\aaTests\virgil\build

creating C:\Dev\aaTests\virgil\build\bdist.win32

creating C:\Dev\aaTests\virgil\build\bdist.win32\winexe

creating C:\Dev\aaTests\virgil\build\bdist.win32\winexe\collect-2.6

creating C:\Dev\aaTests\virgil\build\bdist.win32\winexe\bundle-2.6

creating C:\Dev\aaTests\virgil\build\bdist.win32\winexe\temp

creating C:\Dev\aaTests\virgil\dist

creating C:\Dev\aaTests\virgil\dist\lib

*** searching for required modules ***

copying c:\dev\Py26MSdlls\msvcr90.dll →
C:\Dev\aaTests\virgil\dist\lib\Microsoft.VC90.CRT

copying C:\python26\lib\site-packages\py2exe\run_w.exe →
C:\Dev\aaTests\virgil\dist\simplewx.exe

*** binary dependencies ***

Your executable(s) also depend on these dlls which are not included,

you may or may not need to distribute them.
Which dlls are these?

I found that on my system I could delete the Microsoft.VC90.CRT
folder in dist and simplewx.exe still executed ok.
However, it would not execute if I deleted the lib folder.
Also, if I kept the lib folder but deleted the library.zip
folder in lib, simplewx.exe failed. Perhaps there
are also other files that can be deleted without effecting the
execution of simplewx.exe.

In what form do you distribute your *.exe’s that you have created using
this setup.py?

Make sure you have the license if you distribute any of them, and

make sure you don’t distribute files belonging to the operating system.
How can I determine which files require a license before I distribute
them?

How can I insure that no operating system files are distributed?

OLEAUT32.dll - C:\Windows\system32\OLEAUT32.dll

USER32.dll - C:\Windows\system32\USER32.dll

SHELL32.dll - C:\Windows\system32\SHELL32.dll

KERNEL32.dll - C:\Windows\system32\KERNEL32.dll

COMDLG32.dll - C:\Windows\system32\COMDLG32.dll

WSOCK32.dll - C:\Windows\system32\WSOCK32.dll

MSVCP90.dll - C:\python26\MSVCP90.dll

COMCTL32.dll - C:\Windows\system32\COMCTL32.dll

ADVAPI32.dll - C:\Windows\system32\ADVAPI32.dll

GDI32.dll - C:\Windows\system32\GDI32.dll

WINMM.dll - C:\Windows\system32\WINMM.dll

ole32.dll - C:\Windows\system32\ole32.dll

gdiplus.dll -
C:\python26\lib\site-packages\wx-2.8-msw-unicode\wx\gdiplus.dll

RPCRT4.dll - C:\Windows\system32\RPCRT4.dll

This also works correctly. Thanks very much Werner for your help in
getting me through this problem. --V

···

:slight_smile:

Virgil,

Virgil Stokes wrote:
...

*** binary dependencies ***
Your executable(s) also depend on these dlls which are not included,
you may or may not need to distribute them.

Which dlls are these?

They are listed in that output, I just cut it from the email (to keep it smaller). Most of them are in my experience system dll's so you do NOT want to distribute them. You basically have to look at each of them and find out what it is and then decide if you need to include it or not.

In my case I need to include the "msvc*.dll's" but it depends on your application.

I found that on my system I could delete the Microsoft.VC90.CRT folder in dist and simplewx.exe still executed ok.

Sure, as these files are also in the windows\sxs folder - most likely installed by Python 2.6, but they might also have been installed by another application which uses the "msvc" stuff.

However, it would not execute if I deleted the lib folder. Also, if I kept the lib folder but deleted the library.zip folder in lib, simplewx.exe failed.

Sure, all the files it needs are no longer there - e.g. wxPython etc.

Perhaps there are also other files that can be deleted without effecting the execution of simplewx.exe.

It is not easy to do and in most cases not worse the time you spend. If you are concerned about space, then check the library.zip file and check that all the large files included in it are really needed by your application, if they are not needed then adjust your setup.py to exclude them (see the excludes and dll_excludes in the setup.py).

In what form do you distribute your *.exe's that you have created using this setup.py?

I use InnoSetup to create an installer.

See here:
http://wiki.wxpython.org/Deployment

Make sure you have the license if you distribute any of them, and
make sure you don't distribute files belonging to the operating system.

How can I determine which files require a license before I distribute them?
How can I insure that no operating system files are distributed?

Check each one of them.

   OLEAUT32.dll - C:\Windows\system32\OLEAUT32.dll
   USER32.dll - C:\Windows\system32\USER32.dll
   SHELL32.dll - C:\Windows\system32\SHELL32.dll
   KERNEL32.dll - C:\Windows\system32\KERNEL32.dll
   COMDLG32.dll - C:\Windows\system32\COMDLG32.dll
   WSOCK32.dll - C:\Windows\system32\WSOCK32.dll

Above are all OS files.

   MSVCP90.dll - C:\python26\MSVCP90.dll

That is part of msvc* so you need to ensure that it exists on the target machine - I just deploy it into my application folder - you should check the distribution license.

   COMCTL32.dll - C:\Windows\system32\COMCTL32.dll
   ADVAPI32.dll - C:\Windows\system32\ADVAPI32.dll
   GDI32.dll - C:\Windows\system32\GDI32.dll
   WINMM.dll - C:\Windows\system32\WINMM.dll
   ole32.dll - C:\Windows\system32\ole32.dll

they are OS files.

   gdiplus.dll - C:\python26\lib\site-packages\wx-2.8-msw-unicode\wx\gdiplus.dll

You might need to distribute this, depending on which widgets you use in wxPython (no idea which ones uses it)

   RPCRT4.dll - C:\Windows\system32\RPCRT4.dll

This also works correctly. Thanks very much Werner for your help in getting me through this problem. :slight_smile:

You are welcome.
Werner

I also have a tutorial up for using InnoSetup which you might find
helpful. Here's a link: Packaging wxPyMail for Distribution - Mouse Vs Python

Have fun!

Mike

···

On Jul 30, 5:58 am, "Werner F. Bruhin" <wbru...@gmail.com> wrote:

Virgil,

Virgil Stokes wrote:

...>> *** binary dependencies ***
>> Your executable(s) also depend on these dlls which are not included,
>> you may or may not need to distribute them.
> Which dlls are these?

They are listed in that output, I just cut it from the email (to keep it
smaller). Most of them are in my experience system dll's so you do NOT
want to distribute them. You basically have to look at each of them and
find out what it is and then decide if you need to include it or not.

In my case I need to include the "msvc*.dll's" but it depends on your
application.> I found that on my system I could delete the Microsoft.VC90.CRT folder
> in dist and simplewx.exe still executed ok.

Sure, as these files are also in the windows\sxs folder - most likely
installed by Python 2.6, but they might also have been installed by
another application which uses the "msvc" stuff.> However, it would not execute if I deleted the lib folder. Also, if I
> kept the lib folder but deleted the library.zip folder in lib,
> simplewx.exe failed.

Sure, all the files it needs are no longer there - e.g. wxPython etc.> Perhaps there are also other files that can be deleted without
> effecting the execution of simplewx.exe.

It is not easy to do and in most cases not worse the time you spend. If
you are concerned about space, then check the library.zip file and check
that all the large files included in it are really needed by your
application, if they are not needed then adjust your setup.py to exclude
them (see the excludes and dll_excludes in the setup.py).

> In what form do you distribute your *.exe's that you have created
> using this setup.py?

I use InnoSetup to create an installer.

See here:Deployment - wxPyWiki

Mike Driscoll wrote:


Virgil,
Virgil Stokes wrote:
...>> *** binary dependencies ***
Your executable(s) also depend on these dlls which are not included,
you may or may not need to distribute them.
Which dlls are these?

They are listed in that output, I just cut it from the email (to keep it
smaller).  Most of them are in my experience system dll's so you do NOT
want to distribute them.  You basically have to look at each of them and
find out what it is and then decide if you need to include it or not.
In my case I need to include the "msvc*.dll's" but it depends on your
application.> I found that on my system I could delete the Microsoft.VC90.CRT folder
in dist and simplewx.exe still executed ok.
Sure, as these files are also in the windows\sxs folder - most likely
installed by Python 2.6, but they might also have been installed by
another application which uses the "msvc" stuff.> However, it would not execute if I deleted the lib folder. Also, if I
kept the lib folder but deleted the library.zip folder in lib,
simplewx.exe failed.
Sure, all the files it needs are no longer there - e.g. wxPython etc.> Perhaps there are also other files that can be deleted without
effecting the execution of simplewx.exe.
It is not easy to do and in most cases not worse the time you spend.  If
you are concerned about space, then check the library.zip file and check
that all the large files included in it are really needed by your
application, if they are not needed then adjust your setup.py to exclude
them (see the excludes and dll_excludes in the setup.py).
In what form do you distribute your *.exe's that you have created
using this setup.py?

I use InnoSetup to create an installer.
See here:

I also have a tutorial up for using InnoSetup which you might find
helpful. Here's a link: Have fun!

Thanks Mike for this link!

After a few tries, I finally was able to create with the help of Inno
an installer for my wxPython code.

–V

···

wbru...@gmail.comhttp://wiki.wxpython.org/Deploymenthttp://www.blog.pythonlibrary.org/?p=68