[Pythonmac-SIG] py2app uses wrong version of wxPython?

Kevin Ollivier kevino at theolliviers.com
Fri Dec 16 02:05:58 CET 2005


On Dec 14, 2005, at 11:36 AM, Erik Westra wrote:

[snip]

> I'm not sure if the problem is an obscure bug in py2app, if something
> is screwed up in the wxPython 2.6.1.0 library (maybe it includes the
> wrong version of an .so files or something), or if I've done
> something stupid to cause the problem myself.  But, whatever the
> cause, it seems very strange that the following code:
>
>      import wx
>      print wx.__version__
>
> prints "2.6.1.0" when run in the Python interpreter, but prints
> "2.6.0.1" when run as an application bundle built using py2app.
>
> Any suggestions?

When you run py2app, the output should indicate exactly where it is  
getting the wxPython scripts and dlls from. Search the py2app output  
for any instances of 'wx' in the filename, then track down those  
locations and see what the wxPython version is there. I've released  
bundles using 2.6.1.0 so I don't think that in and of itself is the  
problem here.

Thanks,

Kevin

> Note: I'm not using wxversion to choose the version of wxPython to
> use, so that shouldn't be causing any problems.
>
> In case it helps, here's a (simplified) copy of the "setup.py" file
> I'm using to build the application using py2app:
>
> ###################################################################### 
> #
>
> """ setup.py
>
>      Simplified py2app setup script for the "Ensemble" application.
> """
> from distutils.core import setup
> import py2app
> import sys
> import os
>
>
> def rmrf(path):
>      """ Delete the given directory tree.
>      """
>      entries=os.listdir(path)
>      for e in entries:
>          fullname=os.path.join(path,e)
>          if os.path.isdir(fullname):
>              rmrf(fullname)
>          else:
>              os.remove(fullname)
>      os.rmdir(path)
>
>
> def buildApp():
>      """ Build our standalone application, using py2app.
>
>          We store our generated Ensemble.app bundle into the
>          ensemble/build-mac/standalone directory.
>      """
>      if os.path.exists("disk-image"):
>          rmrf("disk-image")
>
>      os.mkdir("disk-image")
>      os.mkdir("disk-image/dNet Ensemble")
>
>      sys.path.insert(0, "../framework") # Won't be necessary with
> py2app v0.1.7
>
>      plist = dict(
>          CFBundleIconFile            = "Ensemble",
>          CFBundleName                = "dNet Ensemble",
>          CFBundleShortVersionString  = "2.x",
>          CFBundleGetInfoString       = "dNet Ensemble 2.x",
>          CFBundleExecutable          = "dNet Ensemble",
>          CFBundleIdentifier          = "com.dnet.ensemble",
>      )
>
>      app = dict(script="../framework/main.py")
>
>      setup(
>          app=[app],
>          options={'py2app' : {'bdist_base' : "temp",
>                               'dist_dir'   : "disk-image/dNet  
> Ensemble",
>                               'iconfile'   : "Ensemble.icns",
>                               'plist'      : plist,
>                               'includes'   : "requiredModules",
>                              },
>                  }
>      )
>
>
> if __name__ == "__main__":
>      buildApp()
>
> ###################################################################### 
> #
>
> Thanks in advance for any suggestions you may have!
>
>   - Erik.
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig



More information about the Pythonmac-SIG mailing list