pyinstaller 1.5.1,NameError:未定义全局名称'zipfile',http://www.pyinstaller.org/ticket/308

时间:2011-09-20 20:44:57

标签: python pyinstaller

问题

出于某种原因,pyinstaller不能为我工作....有人可以帮忙吗?

此处报告了类似情况的错误:http://www.pyinstaller.org/ticket/308

但似乎固定了????

谢谢!

python pyinstaller-1.5.1/Build.py icinga.spec 
checking Analysis
building Analysis because outAnalysis0.toc non existent
running Analysis outAnalysis0.toc
Analyzing: pyinstaller-1.5.1/support/_mountzlib.py
Analyzing: pyinstaller-1.5.1/support/useUnicode.py
Analyzing: icinga.py
I: Analyzing /usr/bin/python
I: Adding libpython2.4.so.1.0 dependency of python
I: Skipping libpthread.so.0 dependency of python
I: Skipping libdl.so.2 dependency of python
I: Adding libutil.so.1 dependency of python
I: Skipping libm.so.6 dependency of python
I: Skipping libc.so.6 dependency of python
I: Analyzing /usr/lib64/libpython2.4.so.1.0
I: Skipping libpthread.so.0 dependency of libpython2.4.so.1.0
I: Skipping libdl.so.2 dependency of libpython2.4.so.1.0
I: Skipping libm.so.6 dependency of libpython2.4.so.1.0
I: Skipping libc.so.6 dependency of libpython2.4.so.1.0
I: Analyzing /lib64/libutil.so.1
I: Skipping libc.so.6 dependency of libutil.so.1
I: Analyzing /usr/lib64/python2.4/lib-dynload/_bisect.so
I: Skipping libpthread.so.0 dependency of _bisect.so
I: Skipping libc.so.6 dependency of _bisect.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/structmodule.so
I: Skipping libpthread.so.0 dependency of structmodule.so
I: Skipping libc.so.6 dependency of structmodule.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/collectionsmodule.so
I: Skipping libpthread.so.0 dependency of collectionsmodule.so
I: Skipping libc.so.6 dependency of collectionsmodule.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/md5module.so
I: Skipping libpthread.so.0 dependency of md5module.so
I: Skipping libc.so.6 dependency of md5module.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/_socketmodule.so
I: Skipping libpthread.so.0 dependency of _socketmodule.so
I: Skipping libc.so.6 dependency of _socketmodule.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/datetime.so
I: Skipping libm.so.6 dependency of datetime.so
I: Skipping libpthread.so.0 dependency of datetime.so
I: Skipping libc.so.6 dependency of datetime.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/_codecs_iso2022.so
I: Skipping libpthread.so.0 dependency of _codecs_iso2022.so
I: Skipping libc.so.6 dependency of _codecs_iso2022.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/_randommodule.so
I: Skipping libpthread.so.0 dependency of _randommodule.so
I: Skipping libc.so.6 dependency of _randommodule.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/_codecs_tw.so
I: Skipping libpthread.so.0 dependency of _codecs_tw.so
I: Skipping libc.so.6 dependency of _codecs_tw.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/mathmodule.so
I: Skipping libpthread.so.0 dependency of mathmodule.so
I: Skipping libc.so.6 dependency of mathmodule.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/fcntlmodule.so
I: Skipping libpthread.so.0 dependency of fcntlmodule.so
I: Skipping libc.so.6 dependency of fcntlmodule.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/itertoolsmodule.so
I: Skipping libpthread.so.0 dependency of itertoolsmodule.so
I: Skipping libc.so.6 dependency of itertoolsmodule.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/cStringIO.so
I: Skipping libpthread.so.0 dependency of cStringIO.so
I: Skipping libc.so.6 dependency of cStringIO.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/shamodule.so
I: Skipping libpthread.so.0 dependency of shamodule.so
I: Skipping libc.so.6 dependency of shamodule.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/_codecs_jp.so
I: Skipping libpthread.so.0 dependency of _codecs_jp.so
I: Skipping libc.so.6 dependency of _codecs_jp.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/arraymodule.so
I: Skipping libpthread.so.0 dependency of arraymodule.so
I: Skipping libc.so.6 dependency of arraymodule.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/_heapq.so
I: Skipping libpthread.so.0 dependency of _heapq.so
I: Skipping libc.so.6 dependency of _heapq.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/binascii.so
I: Skipping libpthread.so.0 dependency of binascii.so
I: Skipping libc.so.6 dependency of binascii.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/_localemodule.so
I: Skipping libpthread.so.0 dependency of _localemodule.so
I: Skipping libc.so.6 dependency of _localemodule.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/termios.so
I: Skipping libpthread.so.0 dependency of termios.so
I: Skipping libc.so.6 dependency of termios.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/_codecs_cn.so
I: Skipping libpthread.so.0 dependency of _codecs_cn.so
I: Skipping libc.so.6 dependency of _codecs_cn.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/unicodedata.so
I: Skipping libpthread.so.0 dependency of unicodedata.so
I: Skipping libc.so.6 dependency of unicodedata.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/_codecs_kr.so
I: Skipping libpthread.so.0 dependency of _codecs_kr.so
I: Skipping libc.so.6 dependency of _codecs_kr.so
I: Analyzing /usr/lib64/python2.4/lib-dynload/zlibmodule.so
I: Adding libz.so.1 dependency of zlibmodule.so
I: Skipping libpthread.so.0 dependency of zlibmodule.so
I: Skipping libc.so.6 dependency of zlibmodule.so
I: Analyzing /usr/lib64/python2.4/site-packages/MySQL_python-1.2.3-py2.4-linux-x86_64.egg/_mysql.so
Traceback (most recent call last):
  File "pyinstaller-1.5.1/Build.py", line 1494, in ?
    main(args[0], configfilename=opts.configfile)
  File "pyinstaller-1.5.1/Build.py", line 1472, in main
    build(specfile)
  File "pyinstaller-1.5.1/Build.py", line 1429, in build
    execfile(spec)
  File "icinga.spec", line 3, in ?
    pathex=['/home/vboulytchev/projects/icinga'])
  File "pyinstaller-1.5.1/Build.py", line 347, in __init__
    self.__postinit__()
  File "pyinstaller-1.5.1/Build.py", line 298, in __postinit__
    self.assemble()
  File "pyinstaller-1.5.1/Build.py", line 469, in assemble
    manifest=depmanifest))
  File "/home/vboulytchev/projects/icinga/pyinstaller-1.5.1/bindepend.py", line 348, in Dependencies
    for lib, npth in selectImports(pth, platform, xtrapath):
  File "/home/vboulytchev/projects/icinga/pyinstaller-1.5.1/bindepend.py", line 572, in selectImports
    dlls = getImports(pth, platform=platform)
  File "/home/vboulytchev/projects/icinga/pyinstaller-1.5.1/bindepend.py", line 678, in getImports
    pth = check_extract_from_egg(pth)[0][0]
  File "/home/vboulytchev/projects/icinga/pyinstaller-1.5.1/bindepend.py", line 423, in check_extract_from_egg
    except zipfile.BadZipfile, e:
NameError: global name 'zipfile' is not defined

1 个答案:

答案 0 :(得分:0)

在pyinstaller目录中打开文件bindepend.py,您将看到仅在Windows操作系统上使用的语句“import zipfile”。

只需在声明“if”之前添加“import zipfile”,它对我有效。