0


解决ImportError: Bad git executable.

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

在报错的链接处,点进去然后在 import git 或 from git import xxx前面加一行os.environ[“GIT_PYTHON_REFRESH”] = “quiet”

亲测有用

标签: git

本文转载自: https://blog.csdn.net/weixin_46574699/article/details/123502979
版权归原作者 热烈的南风 所有, 如有侵权,请联系我们删除。

“解决ImportError: Bad git executable.”的评论:

还没有评论