<tfoot id='uss6X'></tfoot>

    <small id='uss6X'></small><noframes id='uss6X'>

  • <legend id='uss6X'><style id='uss6X'><dir id='uss6X'><q id='uss6X'></q></dir></style></legend>

  • <i id='uss6X'><tr id='uss6X'><dt id='uss6X'><q id='uss6X'><span id='uss6X'><b id='uss6X'><form id='uss6X'><ins id='uss6X'></ins><ul id='uss6X'></ul><sub id='uss6X'></sub></form><legend id='uss6X'></legend><bdo id='uss6X'><pre id='uss6X'><center id='uss6X'></center></pre></bdo></b><th id='uss6X'></th></span></q></dt></tr></i><div id='uss6X'><tfoot id='uss6X'></tfoot><dl id='uss6X'><fieldset id='uss6X'></fieldset></dl></div>

    • <bdo id='uss6X'></bdo><ul id='uss6X'></ul>

        Kivy 1.9.0 Windows 包 KeyError: 'rthooks'

        Kivy 1.9.0 Windows package KeyError: #39;rthooks#39;(Kivy 1.9.0 Windows 包 KeyError: rthooks)
        <i id='LB4M1'><tr id='LB4M1'><dt id='LB4M1'><q id='LB4M1'><span id='LB4M1'><b id='LB4M1'><form id='LB4M1'><ins id='LB4M1'></ins><ul id='LB4M1'></ul><sub id='LB4M1'></sub></form><legend id='LB4M1'></legend><bdo id='LB4M1'><pre id='LB4M1'><center id='LB4M1'></center></pre></bdo></b><th id='LB4M1'></th></span></q></dt></tr></i><div id='LB4M1'><tfoot id='LB4M1'></tfoot><dl id='LB4M1'><fieldset id='LB4M1'></fieldset></dl></div>

          <small id='LB4M1'></small><noframes id='LB4M1'>

          • <bdo id='LB4M1'></bdo><ul id='LB4M1'></ul>
              <tbody id='LB4M1'></tbody>

            • <tfoot id='LB4M1'></tfoot><legend id='LB4M1'><style id='LB4M1'><dir id='LB4M1'><q id='LB4M1'></q></dir></style></legend>

                  本文介绍了Kivy 1.9.0 Windows 包 KeyError: 'rthooks'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试为 Windows 打包我的 Kivy 应用程序,但遇到了一些问题.按照 kivy docs 中的说明,我创建并编辑了规范文件.我既不使用 pygame 也不使用 SDL2(我的意思是我不直接导入它们来运行我的程序),但在 Kivy 日志中我看到 pygame 仍然提供我的窗口:

                  I'm trying to package my Kivy app for Windows, but I'm having some issues. Following the instructions in the kivy docs, I created and edited the spec file. I don't use neither pygame nor SDL2 (I mean I don't import them directly to run my program), but in the Kivy log I see pygame still provides my window:

                  [INFO              ] [Text        ] Provider: pygame
                  [INFO              ] [Window      ] Provider: pygame
                  

                  我不明白为什么,因为我使用的是 kivy 1.9.0.

                  I don't understand why, since I'm using kivy 1.9.0.

                  也就是说,我在构建规范时遇到了这个问题:

                  Said that, I'm having this problem when building the spec:

                  (...)
                  202 WARNING: stderr:    File "C:Program FilesPython Kivy-1.9.0-py3.4-win32-x86kivy34kivy	oolspackagingpyinstaller_hooks\__init__.py", line 13, in install_hooks
                      sym['rthooks']['kivy'] = [join(curdir, 'rt-hook-kivy.py')]
                  202 WARNING: stderr:    sym['rthooks']['kivy'] = [join(curdir, 'rt-hook-kivy.py')]
                      KeyError: 'rthooks'
                  202 WARNING: stderr: KeyError: 'rthooks'
                  

                  我对编辑规范有点困惑(我需要导入 pygame/SDL2?),这可能是我的问题.我正在使用 Windows 7 x86、Python 3.4.3 和 Kivy 1.9.0.任何帮助表示赞赏.

                  I'm a little confused about editing the spec (I need to import pygame/SDL2?), and that's probably my problem. I'm using Windows 7 x86, Python 3.4.3 and Kivy 1.9.0. Any help is appreciated.

                  推荐答案

                  2015 年 10 月 1 日更新:

                  事实证明这是一个错误.截至 2015 年 9 月 24 日的最新进展Kivy 版本应该没有这个问题.

                  It turns out this is a bug. As of 24 September 2015 the latest development version of Kivy should be free of this issue.

                  从源代码在 Windows 上安装 Kivy,不使用 Christoph Gohlke 的预编译轮子,虽然是另一个难以破解的难题,所以在实践中,如果你真的渴望 Python 3.x 兼容性,可能最简单的方法是等到 Kivy 团队发布 1.9.0 之后的另一个版本,然后 Gohlke 的脚本生成简单的- 安装二进制文件.

                  Installing Kivy on Windows from source code, without the use of Christoph Gohlke's pre-compiled wheels, is another tough nut to crack though, so in practice if you truly crave Python 3.x compatibility it may be easiest to wait until the Kivy team issues another release past 1.9.0, and Gohlke's script to generate the easy-to-install binary.

                  我已经部分解决了这个问题:

                  I've partially troubleshooted this:

                  您引用的 kivy docs 提到将以下三行添加到顶部.spec 文件:

                  The kivy docs you reference mention adding the following three lines to the top of the .spec file:

                  from kivy.tools.packaging.pyinstaller_hooks import install_hooks
                  import os
                  install_hooks(globals())
                  

                  错误发生在 install_hooks(globals()) 中,定义在 Libsite-packageskivy oolspackagingpyinstaller_hooks\__init__.py:

                  The error is happening in install_hooks(globals()), which is defined at Libsite-packageskivy oolspackagingpyinstaller_hooks\__init__.py:

                  from os.path import dirname, join
                  from functools import partial
                  
                  curdir = dirname(__file__)
                  
                  def install_hooks(sym, hookspath=None):
                  
                      _hookspath = [curdir]
                      if hookspath is not None:
                          _hookspath += hookspath
                  
                      sym['rthooks']['kivy'] = [join(curdir, 'rt-hook-kivy.py')]
                      sym['Analysis'] = partial(sym['Analysis'], hookspath=_hookspath)
                  

                  但倒数第二行导致消息:WARNING: stderr: KeyError: 'rthooks'.

                  But the second last line is causing the message: WARNING: stderr: KeyError: 'rthooks'.

                  所以看起来它期望一个变量 rthooks 在全局命名空间中,但事实并非如此.

                  So it looks like it's expecting a variable rthooks to be in the global namespace, but it's not.

                  我不确定下一步该做什么.

                  I'm not sure what to do next.

                  这篇关于Kivy 1.9.0 Windows 包 KeyError: 'rthooks'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Python Kivy: how to call a function on button click?(Python Kivy:如何在按钮单击时调用函数?)
                  How to disable a widget in Kivy?(如何禁用 Kivy 中的小部件?)
                  Centering an object in Kivy(在 Kivy 中将对象居中)
                  How to downgrade to Python 3.4 from 3.5(如何从 Python 3.5 降级到 Python 3.4)
                  Change button or label text color in kivy(在kivy中更改按钮或标签文本颜色)
                  Kivy - Bind Label Text To Variable (Python Only)(Kivy - 将标签文本绑定到变量(仅限 Python))
                  1. <small id='2vNy0'></small><noframes id='2vNy0'>

                    <i id='2vNy0'><tr id='2vNy0'><dt id='2vNy0'><q id='2vNy0'><span id='2vNy0'><b id='2vNy0'><form id='2vNy0'><ins id='2vNy0'></ins><ul id='2vNy0'></ul><sub id='2vNy0'></sub></form><legend id='2vNy0'></legend><bdo id='2vNy0'><pre id='2vNy0'><center id='2vNy0'></center></pre></bdo></b><th id='2vNy0'></th></span></q></dt></tr></i><div id='2vNy0'><tfoot id='2vNy0'></tfoot><dl id='2vNy0'><fieldset id='2vNy0'></fieldset></dl></div>

                        • <tfoot id='2vNy0'></tfoot>
                          <legend id='2vNy0'><style id='2vNy0'><dir id='2vNy0'><q id='2vNy0'></q></dir></style></legend>

                            <bdo id='2vNy0'></bdo><ul id='2vNy0'></ul>

                              <tbody id='2vNy0'></tbody>