View Revisions: Issue #4469

Summary 0004469: Bad git executable error while building python-GitPython
Revision 2017-10-26 22:02 by lassoan
Description

On Windows10, python-GitPython fails with the error message below.

First I added git.exe's folder to PATH env var, and the build succeeded.
However, when I tried to build again simply opening Slicer.sln file in Visual Studio (without adding git.exe's folder to PATH env var), then I got the error message below.

In general, in Windows it is not safe to add the folder of any applications, tools, or utilities to the PATH environment variable globally, so it would be really bad if Slicer build would require something like this. It should be possible to set git.exe path through CMake (and only once, when configuring the project).

48> writing dependency_links to GitPython.egg-info\dependency_links.txt
48> reading manifest file 'GitPython.egg-info\SOURCES.txt'
48> reading manifest template 'MANIFEST.in'
48> writing manifest file 'GitPython.egg-info\SOURCES.txt'
48> removing 'C:\D\S4R\python-install\Lib\site-packages\GitPython-2.1.7-py2.7.egg-info' (and everything under it)
48> Copying GitPython.egg-info to C:\D\S4R\python-install\Lib\site-packages\GitPython-2.1.7-py2.7.egg-info
48> running install_scripts
48> Performing install tree cleanup for 'python-GitPython'
48> Traceback (most recent call last):
48> File "C:/D/S4R/python-GitPython-prefix/tmp/python-GitPython_install_tree_cleanup.py", line 1, in <module>
48> import git
48> File "C:\D\S4R\python-install\Lib\site-packages\git__init.py", line 82, in <module>
48> refresh()
48> File "C:\D\S4R\python-install\Lib\site-packages\git\
init__.py", line 73, in refresh
48> if not Git.refresh(path=path):
48> File "C:\D\S4R\python-install\Lib\site-packages\git\cmd.py", line 293, in refresh
48> raise ImportError(err)
48> ImportError: Bad git executable.
48> The git executable must be specified in one of the following ways:
48> - be included in your $PATH
48> - be set via $GIT_PYTHON_GIT_EXECUTABLE
48> - explicitly set via git.refresh()
48>
48> All git commands will error until this is rectified.
48>
48> This initial warning can be silenced or aggravated in the future by setting the
48> $GIT_PYTHON_REFRESH environment variable. Use one of the following values:
48> - quiet|q|silence|s|none|n|0: for no warning or exception
48> - warn|w|warning|1: for a printed warning
48> - error|e|raise|r|2: for a raised exception
48>
48> Example:
48> export GIT_PYTHON_REFRESH=quiet
48>
48>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(170,5): error MSB6006: "cmd.exe" exited with code 1.

Revision 2017-10-26 17:03 by lassoan
Description

On Windows10, python-GitPython fails with the error message below. git folder is in the PATH (but it should not be required anyway).

48> writing dependency_links to GitPython.egg-info\dependency_links.txt
48> reading manifest file 'GitPython.egg-info\SOURCES.txt'
48> reading manifest template 'MANIFEST.in'
48> writing manifest file 'GitPython.egg-info\SOURCES.txt'
48> removing 'C:\D\S4R\python-install\Lib\site-packages\GitPython-2.1.7-py2.7.egg-info' (and everything under it)
48> Copying GitPython.egg-info to C:\D\S4R\python-install\Lib\site-packages\GitPython-2.1.7-py2.7.egg-info
48> running install_scripts
48> Performing install tree cleanup for 'python-GitPython'
48> Traceback (most recent call last):
48> File "C:/D/S4R/python-GitPython-prefix/tmp/python-GitPython_install_tree_cleanup.py", line 1, in <module>
48> import git
48> File "C:\D\S4R\python-install\Lib\site-packages\git__init.py", line 82, in <module>
48> refresh()
48> File "C:\D\S4R\python-install\Lib\site-packages\git\
init__.py", line 73, in refresh
48> if not Git.refresh(path=path):
48> File "C:\D\S4R\python-install\Lib\site-packages\git\cmd.py", line 293, in refresh
48> raise ImportError(err)
48> ImportError: Bad git executable.
48> The git executable must be specified in one of the following ways:
48> - be included in your $PATH
48> - be set via $GIT_PYTHON_GIT_EXECUTABLE
48> - explicitly set via git.refresh()
48>
48> All git commands will error until this is rectified.
48>
48> This initial warning can be silenced or aggravated in the future by setting the
48> $GIT_PYTHON_REFRESH environment variable. Use one of the following values:
48> - quiet|q|silence|s|none|n|0: for no warning or exception
48> - warn|w|warning|1: for a printed warning
48> - error|e|raise|r|2: for a raised exception
48>
48> Example:
48> export GIT_PYTHON_REFRESH=quiet
48>
48>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(170,5): error MSB6006: "cmd.exe" exited with code 1.

Slicer build completes and Slicer runs anyway.