31

I am trying to install mongodb_engine with my python django application, however I am getting this error

Cannot find command 'git'

I am trying this command from mongodb documentation. http://django-mongodb-engine.readthedocs.org/en/latest/topics/setup.html

pip install git+https://github.com/django-nonrel/[email protected]

I believe git here is causing the problem since the project is stored in git repo. Is there a way to install git to run this pip command? I tried multiple sources but wasn't able to get it to work.

1
  • I am facing the same problem. Were you able to resolve it? Did you install 'git' ? Where did you install it from? Can you please tell me the whole thing you did. Thanks a lot. Commented May 9, 2015 at 5:53

5 Answers 5

54

If your using Anacoda, then you can try this

conda install git
2
  • You're correct!
    – Sang9xpro
    Commented Nov 24, 2021 at 7:47
  • You'll also need to add the installed directory to your PATH. In my case, that was $User\Anaconda3\Library\bin\ Commented Jan 5, 2022 at 18:17
24

Download and Install git in your windows from here:

https://git-scm.com/download/win

Then add its installation bin path to your windows's environment path. Then you will find the git command at the command prompt globally.

This may solve you problem.

How to change environment variables : Git: Installing Git in PATH with GitHub client for Windows

For Visual studio code restart after adding the environment variables

1
  • Where to install the git from? I see a lot of git program online. I am not sure which one to install. Can you please tell me? Commented May 9, 2015 at 5:51
2

Add the path of git.exe to your windows environment variable called 'path'. My git.exe is in the path of 'C:\Users\LW\AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad\bin\git.exe'. Your can find your exe file in the similar folder path.

0

You can install git and configure the path with the git directory in System variables path.

2
  • 1
    is it different to the highest rated accepted answer to this question? Commented Jan 10, 2020 at 1:41
  • It's more like a comment then an answer. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers according to guide
    – Anna
    Commented Jan 10, 2020 at 2:16
0

Step-1: Install git https://git-scm.com/download/win

Step-2: While installing "Check Add Git to Path" so that can be accessed via CMD.

Step-3: If in case, you've missed the step - 2, then makesure that your environment variable list has the following:

enter image description here

It should be done by now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.