遇到的错误
Traceback (most recent call last):
File "E:\Users\user\anaconda3\envs\torch17\lib\site-packages\git\__init__.py", line 89, in <module>
refresh()
File "E:\Users\user\anaconda3\envs\torch17\lib\site-packages\git\__init__.py", line 76, in refresh
if not Git.refresh(path=path):
File "E:\Users\user\anaconda3\envs\torch17\lib\site-packages\git\cmd.py", line 392, in refresh
raise ImportError(err)
ImportError: Bad git executable.
解决方案
在E:\Users\user\anaconda3\envs\torch17\lib\site-packages\git_init_.py 的第76行之前添加一行代码
os.environ['GIT_PYTHON_REFRESH'] = 'quiet'