\n\nI opened CMD and entered the following command
\npip install GitPythonto install git
GitPython provides a git module for Python code, but it does not provide Git itself. GitPython does most of its work by using the external git command that Git provides. So GitPython needs Git to be present.
For the GitPython git module to make use of this external git command, the external command must either be runnable as git from the environment in which you run the Python process that uses GitPython, or specially configured as described in the message you saw. In most cases, it either is present as git or is intended to be present as git.
Is Git installed? If it is installed and usable, then running git version from the command line should show something like git version 2.43.0.windows.1.
If you are able to successfully run git version from the same command line that you run python on, then GitPython should usually be able to use it as well, and if it cannot then this might be due to a bug in GitPython. But if git version does not work when you run it, then GitPython will usually be unable to run the external git command for the same reason you are unable to run it directly (whatever that reason happens to be).
-
|
Today while working on a project on Python I needed to import git module so in I opened CMD and entered the following command |
Beta Was this translation helpful? Give feedback.
-
GitPython provides a For the GitPython Is Git installed? If it is installed and usable, then running If you are able to successfully run |
Beta Was this translation helpful? Give feedback.
GitPython provides a
gitmodule for Python code, but it does not provide Git itself. GitPython does most of its work by using the externalgitcommand that Git provides. So GitPython needs Git to be present.For the GitPython
gitmodule to make use of this externalgitcommand, the external command must either be runnable asgitfrom the environment in which you run the Python process that uses GitPython, or specially configured as described in the message you saw. In most cases, it either is present asgitor is intended to be present asgit.Is Git installed? If it is installed and usable, then running
g…