【问题标题】:How can i fix this error when installing kivy designer?安装 kivy 设计器时如何解决此错误?
【发布时间】:2019-06-26 21:40:56
【问题描述】:

每次我尝试安装 kivy 设计器时都会出现错误,每当我修复一个错误时,我都会发现另一个错误,有人可以帮助我吗 我按照本网站https://kivy-designer.readthedocs.io/en/latest/installation.html#id2 的说明进行操作,并下载了所需的所有先决条件 我写: python -m 设计器

我收到以下错误:

[INFO   ] [Logger      ] Record log in C:\Users\Amr\.kivy\logs\kivy_19-02-02_14.txt
[INFO   ] [Kivy        ] v1.10.1
[INFO   ] [Python      ] v3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)]
[INFO   ] [Factory     ] 194 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] GLEW initialization succeeded
[INFO   ] [GL          ] Backend used <glew>
[INFO   ] [GL          ] OpenGL version <b'4.5.0 - Build 23.20.16.4973'>
[INFO   ] [GL          ] OpenGL vendor <b'Intel'>
[INFO   ] [GL          ] OpenGL renderer <b'Intel(R) HD Graphics 620'>
[INFO   ] [GL          ] OpenGL parsed version: 4, 5
[INFO   ] [GL          ] Shading version <b'4.50 - Build 23.20.16.4973'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <32>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [Localization file loaded (C]\Users\Amr\.kivy\garden\garden.xpopup\xpopup.mo).
[INFO   ] [Clipboard   ] Provider: winctypes
 Traceback (most recent call last):
   File "C:\Users\Amr\AppData\Local\Programs\Python\Python37\lib\site-packages\git\__init__.py", line 83, in <module>
     refresh()
   File "C:\Users\Amr\AppData\Local\Programs\Python\Python37\lib\site-packages\git\__init__.py", line 73, in refresh
     if not Git.refresh(path=path):
   File "C:\Users\Amr\AppData\Local\Programs\Python\Python37\lib\site-packages\git\cmd.py", line 290, in refresh
     raise ImportError(err)
 ImportError: Bad git executable.
 The git executable must be specified in one of the following ways:
     - be included in your $PATH
     - be set via $GIT_PYTHON_GIT_EXECUTABLE
     - explicitly set via git.refresh()

 All git commands will error until this is rectified.

 This initial warning can be silenced or aggravated in the future by setting the
 $GIT_PYTHON_REFRESH environment variable. Use one of the following values:
     - quiet|q|silence|s|none|n|0: for no warning or exception
     - warn|w|warning|1: for a printed warning
     - error|e|raise|r|2: for a raised exception

 Example:
     export GIT_PYTHON_REFRESH=quiet


 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "C:\Users\Amr\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
 "__main__", mod_spec)
   File "C:\Users\Amr\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
 exec(code, run_globals)
   File "C:\Users\Amr\Downloads\kivy-designer-master\kivy-designer-master\designer\__main__.py", line 17, in <module>
 main()
   File "C:\Users\Amr\Downloads\kivy-designer-master\kivy-designer-master\designer\__main__.py", line 13, in main
 DesignerApp().run()
   File "C:\Users\Amr\AppData\Local\Programs\Python\Python37\lib\site-packages\kivy\app.py", line 800, in run
 root = self.build()
   File "C:\Users\Amr\Downloads\kivy-designer-master\kivy-designer-master\designer\app.py", line 1738, in build
 self.root = Designer()
   File "C:\Users\Amr\Downloads\kivy-designer-master\kivy-designer-master\designer\app.py", line 207, in __init__
 super(Designer, self).__init__(**kwargs)
   File "C:\Users\Amr\AppData\Local\Programs\Python\Python37\lib\site-packages\kivy\uix\floatlayout.py", line 65, in __init__
 super(FloatLayout, self).__init__(**kwargs)
   File "C:\Users\Amr\AppData\Local\Programs\Python\Python37\lib\site-packages\kivy\uix\layout.py", line 76, in __init__
 super(Layout, self).__init__(**kwargs)
   File "C:\Users\Amr\AppData\Local\Programs\Python\Python37\lib\site-packages\kivy\uix\widget.py", line 348, in __init__
 Builder.apply(self, ignored_consts=self._kwargs_applied_init)
   File "C:\Users\Amr\AppData\Local\Programs\Python\Python37\lib\site-packages\kivy\lang\builder.py", line 469, in apply
 self._apply_rule(widget, rule, rule, ignored_consts=ignored_consts)
   File "C:\Users\Amr\AppData\Local\Programs\Python\Python37\lib\site-packages\kivy\lang\builder.py", line 585, in _apply_rule
 self._apply_rule(child, crule, rootrule)
   File "C:\Users\Amr\AppData\Local\Programs\Python\Python37\lib\site-packages\kivy\lang\builder.py", line 585, in _apply_rule
 self._apply_rule(child, crule, rootrule)
   File "C:\Users\Amr\AppData\Local\Programs\Python\Python37\lib\site-packages\kivy\lang\builder.py", line 585, in _apply_rule
 self._apply_rule(child, crule, rootrule)
   File "C:\Users\Amr\AppData\Local\Programs\Python\Python37\lib\site-packages\kivy\lang\builder.py", line 544, in _apply_rule
 cls = Factory_get(cname)
   File "C:\Users\Amr\AppData\Local\Programs\Python\Python37\lib\site-packages\kivy\factory.py", line 142, in __getattr__
 level=0  # force absolute
   File "C:\Users\Amr\Downloads\kivy-designer-master\kivy-designer-master\designer\tools\git_integration.py", line 23, in <module>
 from git import GitCommandError, RemoteProgress, Repo
    File "C:\Users\Amr\AppData\Local\Programs\Python\Python37\lib\site-packages\git\__init__.py", line 85, in <module>
     raise ImportError('Failed to initialize: {0}'.format(exc))
 ImportError: Failed to initialize: Bad git executable.
The git executable must be specified in one of the following ways:
 - be included in your $PATH
 - be set via $GIT_PYTHON_GIT_EXECUTABLE
 - explicitly set via git.refresh()

 All git commands will error until this is rectified.

 This initial warning can be silenced or aggravated in the future by setting the
 $GIT_PYTHON_REFRESH environment variable. Use one of the following values:
     - quiet|q|silence|s|none|n|0: for no warning or exception
     - warn|w|warning|1: for a printed warning
     - error|e|raise|r|2: for a raised exception

 Example:
     export GIT_PYTHON_REFRESH=quiet

我运行 Windows 10 64 位

如果有人能帮助我真的很感激

提前致谢

【问题讨论】:

  • 嗨,欢迎来到 StackOverflow。您是否按照错误消息的提示安装并设置了 git?
  • 感谢您的热烈欢迎...原来我需要做的就是将 git 添加到路径中,非常感谢您的帮助,我真的很感激

标签: python python-3.x git windows-10 kivy


【解决方案1】:

尝试将包含“git.exe”的目录添加到PATH, 这是你应该怎么做https://www.computerhope.com/issues/ch000549.htm (您可能需要在添加 PC 后重新启动 PC 才能获得新的 PATH 环境变量)

【讨论】:

  • 成功了!非常感谢您的帮助,我真的很感激
  • 嗨@Python_Master 很高兴我帮助了你。请考虑接受我的回答,这将表明该解决方案对您有用的其他 Stackoverflow 用户。此外,这会给我们双方带来声誉。
  • 抱歉,这是我第一次使用 Stack Overflow……是不是很麻烦?
【解决方案2】:

Kivy Designer 已弃用且无法真正使用,我们强烈建议不要使用它。

【讨论】:

  • 我试过kivy,我太困惑了,如果你能给我一门非常感激的课程,我找不到一个像样的课程来学习
  • @Python_Master 在 YouTube 上有许多涵盖基础知识的教程,你检查过吗?选择一个新框架一开始可能会让人望而生畏,但如果你坚持下去就会有意义。直接使用 kivy 而不是 Kivy Designer 也会有更多帮助
猜你喜欢
  • 2021-12-23
  • 1970-01-01
  • 1970-01-01
  • 2021-03-25
  • 2023-03-22
  • 2022-01-24
  • 1970-01-01
  • 2016-11-10
  • 2018-10-11
相关资源
最近更新 更多