From <http://article.gmane.org/gmane.comp.python.pyinstaller/5416>, 2012-12-23 10:58:
I am attaching source for two packages, nnsA (nested namespace A) and nnsA.B.C, where nnsA.B is declared as a namespace-package; nnsA contains console script (runNnsA) which tries to import nnsA.B and prints whether it succeeded or not. I tested that setup with your development branch (git://github.com/matysek/pyinstaller.git).
Preperation un-flatten the files in the gist:
for i in *---* ; do j=$(echo $i | sed 's!---!/!g') mkdir -p $(dirname $j) mv $i $j done
Non-frozen installation:
virtualenv . . bin/activate cd nnsA python setup.py install runNnsA # should give: "nnsA.B: ImportError" cd ../nnsA.B.C python setup.py install runNnsA # should give: "nnsA.B: imported" cd ../nanspZ python setup.py install runNnsA # should give: "nanspZ: imported"
works just fine: nnsA.B is not imported when nnsA.B.C is not installed, and it imported when nnsA.B.C is installed.
Frozen installation:
cd ../nnsA.B.C python setup.py bdist_egg cd ../nanspZ/ python setup.py bdist_egg cd ../nnsA python setup.py install python /path/to/pyinstaller/pyinstaller.py -y pyinstaller.spec dist/nnsA-frozen/runNnsA.exe # should give: "nnsA.B: ImportError" # should give: "nanspZ: ImportError" cd ../nnsA mkdir dist/nnsA-frozen/eggs cp ../{nnsA.B.C,nanspZ}/dist/*.egg dist/nnsA-frozen/eggs/
does not import nnsA.B when nnsA.B.C's egg is not installed, but it fails importing nnsA.B when nnsA.B.C-0.0.0-py2.7.egg is dropped into nnsA/dist/nnsA-frozen/eggs dir.
Flatten the files:
for i in $(lf * | grep / ) ; do j=$(echo $i | sed 's!/!---!g') echo git mv $i ./$j done | sh