[Pythonmac-SIG] py2app: Packing my modules in site-packages.py
Christopher Barker
Chris.Barker at noaa.gov
Fri Nov 7 22:05:36 CET 2008
Nirnimesh wrote:
> My
> main script (/Users/nirnimesh/my_app/main.py) alters sys.path to make
> the dependency modules importable (ie. sys.path.append('..'))
Ideally, avoid that. A better alternative is to install your own modules
into the system with setuptools --develop option:
python setup.py develop
If you really do need to add to sys.path, then:
> Alternatively, if I alter sys.path in my setup.py script itself, can I
> expect my dependency modules to get packaged in site-packages.zip?
yes, that should work -- but you'll probably not want to add that
sys.path.append in your code -- you can check for the "sys.frozen"
attribute to know if the code is running inside an app bundle or not.
-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 Pythonmac-SIG
mailing list