pytz issues

219 views
Skip to first unread message

Jamie Kirkpatrick

unread,
May 13, 2009, 6:20:12 AM5/13/09
to PyIns...@googlegroups.com
Hi there

I've had an issue for some time which prevents me from using the current trunk.  See the ouput from my executable built in debug mode:

KidA% ./PrWebServices 
thisfile is ./PrWebServices
_MEIPASS2 (workpath) is NULL
homepath is ./
Extracting binaries
Executing self as child with LD_LIBRARY_PATH=/var/folders/gD/gDkFCkxTGOyzotDoOXSAY++++TI/-Tmp-//_MEILzo0ym
DYLD_LIBRARY_PATH=/var/folders/gD/gDkFCkxTGOyzotDoOXSAY++++TI/-Tmp-//_MEILzo0ym:/Users/jkp/Development/Prestige/git/Deliver/Debug
thisfile is ./PrWebServices
_MEIPASS2 (workpath) is /var/folders/gD/gDkFCkxTGOyzotDoOXSAY++++TI/-Tmp-//_MEILzo0ym/
homepath is ./
Already have a workpath - running!
/var/folders/gD/gDkFCkxTGOyzotDoOXSAY++++TI/-Tmp-//_MEILzo0ym/Python
Manipulating evironment
PYTHONPATH=/var/folders/gD/gDkFCkxTGOyzotDoOXSAY++++TI/-Tmp-//_MEILzo0ym:.
importing modules from CArchive
extracted iu
extracted struct
extracted archive
Installing import hooks
outPYZ3.pyz
Running scripts
Traceback (most recent call last):
  File "<string>", line 18, in <module>
  File "/Users/jkp/Development/Prestige/git/Build/Env/tools/pyinstaller/iu.py", line 430, in importHook
    mod = _self_doimport(nm, ctx, fqname)
  File "/Users/jkp/Development/Prestige/git/Build/Env/tools/pyinstaller/iu.py", line 515, in doimport
    exec co in mod.__dict__
  File "/Users/jkp/Development/Prestige/git/Build/Temp/Debug/Python/Projects/PrWebServiceBridge/soap.py", line 18, in <module>
    from soaplib.serializers.primitive import String, Integer, DateTime, Null
  File "/Users/jkp/Development/Prestige/git/Build/Env/tools/pyinstaller/iu.py", line 430, in importHook
    mod = _self_doimport(nm, ctx, fqname)
  File "/Users/jkp/Development/Prestige/git/Build/Env/tools/pyinstaller/iu.py", line 515, in doimport
    exec co in mod.__dict__
  File "/Users/jkp/Development/Prestige/git/Build/Temp/Debug/Python/Projects/PrWebServiceBridge/build/pyi.darwin/exe/outPYZ3.pyz/soaplib.serializers.primitive", line 7, in <module>
  File "/Users/jkp/Development/Prestige/git/Build/Env/tools/pyinstaller/iu.py", line 449, in importHook
    raise ImportError, "No module named %s" % fqname
ImportError: No module named pytz
RC: -1 from main
OK.
Back to parent...

I try to leave the detection of pytz to PyInstaller but its no good: it cant seem to pick it up correctly.  In this case I'm explicitly setting it using hiddenimports but still no luck.  Any clues?  This is the case for me on both win32 and osx.

Thanks

--
Jamie Kirkpatrick
07818 422311

Giovanni Bajo

unread,
May 22, 2009, 3:41:36 PM5/22/09
to PyIns...@googlegroups.com

When you see an importerror, there are three alternatives:

1. The package is not detected as an import by PyInstaller. You need to
declare it as hiddenimport. This can't be the case of this e-mail, for
instance, because there's a blatantly clear "import pytz" in line 6 in
soaplib/serializers/primitive.py, and PyInstaller can't miss that.
2. The package is detected but PyInstaller fails to bundle it into the
generated executable. You can check this with ArchiveViewer: do the
package and all its subfiles appear within the executable? If so, we
need to investigate why (eg: is the packaged shipped as .egg?).
3. The package is correctly bundled but PyInstaller at runtime fails to
load it (this, eg., was the case with the recent encodings problems with
Python 2.6). In this case, we need to track and fix a bug in iu.py; the
first thing to try is to turn on debugging support at the top of the
file, and post the output to the mailing list.

BTW, I'll copy this e-mail to the FAQ on the website :)
--
Giovanni Bajo
Develer S.r.l.
http://www.develer.com


Reply all
Reply to author
Forward
0 new messages