大家好,感谢您花时间帮助我。Kivy - 在Windows上创建软件包
我目前正在尝试使用PyInstaller(3.1)为我的Kivy(1.9.1)应用程序创建一个Windows包。我遵循了文档中的说明,但无法使其正常工作。所以我尝试用示例应用“touchtracer”给出了相同的结果。我得到以下错误:
Traceback (most recent call last):
File "<string>", line 11, in <module>
File "f:\temp\pip-build-1elcla\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
File "C:\Python27\lib\site-packages\pkg_resources\__init__.py", line 48, in <module>
from pkg_resources.extern import six
File "C:\Python27\lib\site-packages\pkg_resources\extern\__init__.py", line 60, in load_module
"distribution.".format(**locals())
ImportError: The 'six' package is required; normally this is bundled
with this package so if you get this warning, consult the packager of
your distribution.
pyi_rth_pkgres returned -1
这是我的.spec文件:
# -*- mode: python -*-
from kivy.deps import sdl2, glew
block_cipher = None
a = Analysis(['C:\\Python27\\share\\kivy-examples\\demo\\touchtracer\\main.py'],
pathex=['C:\\Users\\PC\\Documents\\Njord\\njord\\Nouveau dossier'],
binaries=None,
datas=None,
hiddenimports=[],
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='touchtracer',
debug=False,
strip=False,
upx=True,
console=True)
coll = COLLECT(exe, Tree('C:\\Python27\\share\\kivy-examples\\demo\\touchtracer\\'),
a.binaries,
a.zipfiles,
a.datas,
*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
strip=False,
upx=True,
name='touchtracer')
我已经与PIP和与车轮的方法来安装Kivy包试过了,没有成功。有没有人有解释?
再次感谢。
我和OP有同样的问题。然而,出于某种原因,我的系统中没有安装“包装”软件包,所以我收到了关于“打包”不可用的新错误。我可以通过删除pathex目录的内容并运行pip install打包,然后编辑.spec文件来解决此问题。 – user1790399