Pyinstaller编译为exe

特贝克

我试图将Kivy应用程序编译为Windows exe,但是我一直收到属性错误:AttributeError:'str'对象没有属性'items'

我已经编译了其他应用程序,并按照每条kivy页面的说明行进行操作(完成了演示),但是当我尝试对我的应用程序执行相同操作时,会收到上述错误。我不确定该去哪里了,我已经尝试了几个小时,而且似乎没有任何进展。任何帮助将不胜感激。

编辑:下面是堆栈跟踪的尾部,整个过程很长,因此我粘贴了我认为可能相关的内容,但坦率地说,我在这里有点儿太深了:)

6363 WARNING: stderr:   File "c:\python27\lib\site-packages\PyInstaller\depend\a
nalysis.py", line 198, in _safe_import_module
     hook_module.pre_safe_import_module(hook_api)
6375 WARNING: stderr:     hook_module.pre_safe_import_module(hook_api)
   File "c:\python27\lib\site-packages\PyInstaller\hooks\pre_safe_import_module\
hook-six.moves.py", line 55, in pre_safe_import_module
6378 WARNING: stderr:   File "c:\python27\lib\site-packages\PyInstaller\hooks\pr
e_safe_import_module\hook-six.moves.py", line 55, in pre_safe_import_module
     for real_module_name, six_module_name in real_to_six_module_name.items():
6388 WARNING: stderr:     for real_module_name, six_module_name in real_to_six_m
odule_name.items():
 AttributeError: 'str' object has no attribute 'items'
6396 WARNING: stderr: AttributeError: 'str' object has no attribute 'items'

我的规格:

# -*- mode: python -*-
from kivy.deps import sdl2, glew

block_cipher = None


a = Analysis(['face.py'],
             pathex=['c:\\Users\\Home\\PycharmProjects\\MSICheck\\Images'],
             binaries=None,
             datas=None,
             hiddenimports=['sqlite3','kivy.app','six','packaging','packaging.version','packaging.specifiers'],
             hookspath=[],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          exclude_binaries=True,
          name='face',
          debug=True,
          strip=False,
          upx=True,
          console=True )
coll = COLLECT(exe,Tree('c:\\Users\\Home\\PycharmProjects\\MSICheck\\Images\\'),
               a.binaries,
               a.zipfiles,
               a.datas,
               *[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
               strip=False,
               upx=True,
               name='face')

编辑:显然,它与Kivy无关,因为我已经重写了使用TKinter的前端,但是我仍然遇到问题。

精灵豆

如果您仍然遇到此问题,以下是为我解决的问题:

pip install --upgrade setuptools

我试过安装六个(在我的情况下,尚未安装),但是由于它似乎是在寻找,_vendor.six而不仅仅是six,所以并没有解决。以某种方式,升级setuptools可以解决该问题。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何使用pyinstaller将多个子进程python文件编译为单个.exe文件

使用pyinstaller编译为.exe后,PyQt5应用程序中缺少图标

Python !pip 编译为 exe

Cython可以编译为EXE吗?

将C ++(.cpp)编译为.exe文件

在使用 pyinstaller 或其他任何东西将 py 编译为 exe 后,是否可以让控制台仅在特定时间处于活动状态?

pyinstaller编译时找不到exe文件

如何将.C编译为.exe并编辑视图?

将python编译为单个.exe,为什么这么困难?

将Java源代码编译为本机exe

如何使用midlrt.exe将.idl编译为.winmd?

使用cl.exe将asm文件编译为dll

在一个.exe文件中编译为模块

如何将C / C ++程序编译为exe格式

Scrapy + Tkinter-> exe cx冻结(编译为exe后,scrapy函数不起作用)

无法让Py2exe正确编译为一个exe

如何使用 G++ 将文本文件编译为 exe 文件

如何在Microsoft Visual Studio Community 2017中将.py编译为.exe?

不使用Visual Studio IDE将具有多个DLL文件的项目编译为单个EXE

在Windows 10上使用Nuitka将Python 3.6脚本编译为独立exe

无法使用HHC.EXE和Visual Studio 2017 RC将HHP编译为CHM

使用Visual Studio 2017将.NET Core应用程序编译为EXE文件

如何将.NET EXE反编译为可读的C#源代码?

如何将.NET Core 2 MVC Web应用程序编译为EXE?

如何使用命令行将单个C#类文件编译为.exe?

将多个.py文件编译为Windows可执行文件(.exe)

将 vb.net 应用程序编译为独立的 .exe

将VB.NET exe反编译为C#(dotPeek和JustDecompile)

是否可以让 Visual Studio 2017 将 C++ 代码编译为 exe 以外的文件类型?