錯誤如下:
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 添加環(huán)境變量,重啟電腦文章來源:http://www.zghlxwxcb.cn/news/detail-609356.html
尋找git——打開git-bash , 輸入where git??文章來源地址http://www.zghlxwxcb.cn/news/detail-609356.html
到了這里,關于瀟灑郎:gitpython 學習-解決Bad git executable, export GIT_PYTHON_REFRESH=quiet問題的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!