从github下载yolov5 7.0后,运行train.py时出现以下报错,请问应该如何解决?
```python
Traceback (most recent call last):
File "D:\anaconda\envs\yolov5_test\lib\site-packages\git\__init__.py", line 166, in <module>
refresh()
File "D:\anaconda\envs\yolov5_test\lib\site-packages\git\__init__.py", line 153, in refresh
if not Git.refresh(path=path):
File "D:\anaconda\envs\yolov5_test\lib\site-packages\git\cmd.py", line 391, 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
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "F:/code_new/yolov5-7.0/train.py", line 66, in <module>
GIT_INFO = check_git_info()
File "D:\anaconda\envs\yolov5_test\lib\contextlib.py", line 75, in inner
return func(*args, **kwds)
File "F:\code_new\yolov5-7.0\utils\general.py", line 350, in check_git_info
import git
File "D:\anaconda\envs\yolov5_test\lib\site-packages\git\__init__.py", line 168, in <module>
raise ImportError("Failed to initialize: {0}".format(_exc)) from _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
```