我正在學習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