我正在学习Python。git.exc.GitCommandNotFound:[WinError 5]访问被拒绝
获得例外低于试图克隆回购
Traceback (most recent call last):
File "C:\Users\Selvakumar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\git\cmd.py", line 622, in execute
**subprocess_kwargs
File "C:\Users\Selvakumar\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 969, in __init__
restore_signals, start_new_session)
File "C:\Users\Selvakumar\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 1249, in _execute_child
startupinfo)
PermissionError: [WinError 5] Access is denied
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "config_console.py", line 2185, in <module>
command_line = ConfigCommandLine()
File "config_console.py", line 87, in __init__
g.clone('[email protected]:Modria/Ecomm_GM.git')
File "C:\Users\Selvakumar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\git\cmd.py", line 463, in <lambda>
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "C:\Users\Selvakumar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\git\cmd.py", line 905, in _call_process
return self.execute(make_call(), **_kwargs)
File "C:\Users\Selvakumar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\git\cmd.py", line 625, in execute
raise GitCommandNotFound(str(err))
git.exc.GitCommandNotFound: [WinError 5] Access is denied
安装GitPython。 SSH密钥在C:\ Users \ Selvakumar.ssh中可用,并且在从git bash克隆时可用。但是,这不是从python工作。请注意,ssh密钥是在没有密码的情况下生成的。请帮我解决这个问题
你可以确定你的python程序运行在'HOME'设置为'USERPROFILE'的环境中吗?设置'HOME =%USERPROFILE%';调用你的python程序(从regulat CMD会话,而不是git bash)。 – VonC
获取相同的错误。我在环境变量中设置HOME,并从CMD运行(我已经在做) –
您的PATH引用了git二进制文件吗? – VonC