On Tue, 2010-05-04 at 15:44 -0700, Adriano Marques wrote:
> Hello,
>
> While trying to compile a regular python application that uses django,
> I came across this weird behavior:
>
> If I have this directory structure:
>
> django_test/
> django_test/testing (the django project dir)
> django_test/testing/main (the django app dir)
>
> and a spec file like this:
>
> a = Analysis([os.path.join(HOMEPATH,'support/_mountzlib.py'),
> os.path.join(HOMEPATH,'support/useUnicode.py'), '/home/adriano/virtenv/
> django_test/bin/launch.py'],
> pathex=['/PATHHERE/django_test/build/pyi.linux2/
> django_test'])
> pyz = PYZ(a.pure)
> exe = EXE( pyz,
> a.scripts,
> a.binaries,
> a.zipfiles,
> a.datas,
> name=os.path.join('dist', 'launch'),
> debug=False,
> strip=False,
> upx=True,
> console=1 )
>
> It builds and works as a charm. But, if it happens that I have a
> directory structure like this:
>
> django_test/
> django_test/cool
> django_test/cool/testing (the django project dir)
> django_test/cool/testing/main (the django app dir)
>
> Using the same spec, and importing as cool.testing.setting inside the
> code, I have an import error:
>
> adri...@linux:/PATHHERE/django_test/dist$ ./launch
> Error: No module named cool.testing.grigas
>
> Is there any special reason for this behavior? As in pathex I have the
> django_test, it should allow the import (cool does have a __init__.py
> inside it) without any problems, shouldn't it?
Not quite. sys.pathex is used at build-time, but remember that also the
bootstrap script's current directory is automatically part of the
sys.path (standard Python behaviour).
Assuming you follow the advices on the wiki, where is your bootstrap
script located? In your case, I would try putting it in the top-level
directory (though I am not sure if this breaks the django support -- you
will have to try).
--
Giovanni Bajo :: [email protected]
Develer S.r.l. :: http://www.develer.com
My Blog: http://giovanni.bajo.it
Last post: Grey on black: combining greylisting with blacklists
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pyinstaller?hl=en.