[wxPython-users] Cross-platform distribution

Christopher Barker Chris.Barker at noaa.gov
Mon Oct 1 13:55:43 PDT 2007


Dusty Phillips wrote:
> I think its possible for the situation to
> arise where sys.prefix returns /usr and the files are installed to
> /usr/local though.

Indeed, desirable! /usr is for stuff installed by the system vendor, and 
/usr/local is for stuff installed by the user. until you get official 
Ubuntu (or whatever) packages of your app, then python will probably be 
installed in /usr/, and your app should be installed in /usr/local/.

> Probably my best bet is to look in wx.StandardPaths and use sys.prefix
> as a fallback.

I think wxStandardPaths is the way to go -- but I'm not sure how to get 
distutils to match.

> Hmm. I've been reluctant to use Py2exe, as I understand that it ships
> wxPython with the app.

Yes, that's part of the point. I think you could build a py2exe 
executable that relies on the system python+wxPython (I know you can 
with py2app on OS-X), but I don't think that's the right thing to do for 
an app like Pallavi: IIUC, you want it to be a general purpose editor -- 
a user may or may not even have Python installed. Even if it is being 
used for wxPython development, the version of wxPython that the user is 
building their apps with may not be the same one that Pallavi is using. 
indeed, the same applies to Python itself, and any number of other modules.

In short, a Pallavi user should not need to know or care that Pallavi is 
written in Python (or which version, etc) That's what Py2exe is for, 
make a Python app a "normal" Windows app -- not an extension for python.



> It looks like Py2exe is actually a distutils module, rather
> than distinct from it, so I should theoretically be able to use it
> without rearranging my linux installation stuff.

Yup, that's True.

Linux is a different story than Windows or OS-X. In the Linux world, 
people are used to software depending on an assortment of libraries and 
what not. There are also nifty package managers that handle all that for 
the user -- so it's less likely that you'll need to us PyInstaller on 
Linux (even if you do, there are still a bunch of lower-level dependencies!)

If you do depend on a system-installed Python and wxPython, make sure 
you specify versions so that the right one gets used if the user has 
multiple versions installed. i.e.:

/usr/bin/env python2.4

import wxversion
wxversion.select("2.8")

> Yup. I have your "multiple top-level windows" in svn... 

cool! Are you in touch with Rob of the Peppy Project? -- that one looked 
very promising, but he got a bit sidetracked when it was ALMOST ready 
for daily use....

> I
> haven't got "multiple views of the same buffer" yet; that's for 0.7.

That's a bit less critical, but I'm glad you have it on your radar.

> So if I created a py2exe version of distutils you would probably be
> able to make it work using py2app?

Sure, I'd give it a try. I can also help some with making it a good Mac 
citizen -- accepting Drag and Dropped files -- that sort of thing.

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the wxpython-users mailing list