Bootstrap

潇洒郎:gitpython 学习-解决Bad git executable, export GIT_PYTHON_REFRESH=quiet问题

错误如下:

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

错误原因: 无法找到git.exe

解决办法:寻找git.exe, 然后给git.exe 添加环境变量,重启电脑

寻找git——打开git-bash , 输入where git  

添加为环境变量

重启电脑生效-不重启可能不生效

 

悦读

道可道,非常道;名可名,非常名。 无名,天地之始,有名,万物之母。 故常无欲,以观其妙,常有欲,以观其徼。 此两者,同出而异名,同谓之玄,玄之又玄,众妙之门。

;