首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Kivy -在Windows上创建包

Kivy -在Windows上创建包
EN

Stack Overflow用户
提问于 2016-01-20 22:13:08
回答 2查看 1.8K关注 0票数 4

大家好,谢谢你们抽出时间来帮助我。

目前,我正在使用PyInstaller (3.1)为我的Kivy (1.9.1)应用程序创建一个windows包。我遵守了文档中的说明,但没能让它开始工作。所以我试着用演示应用程序'touchtracer‘作为例子,结果是一样的。我得到以下错误:

代码语言:javascript
运行
复制
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文件:

代码语言:javascript
运行
复制
# -*- 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软件包和车轮的方法,但没有成功。有人能解释一下吗?

再次感谢。

EN

Stack Overflow用户

发布于 2016-01-22 17:41:23

我必须加上这一行才能解决这个问题。

hiddenimports=['six','packaging','packaging.version','packaging.specifiers'],

票数 1
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34911658

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档