Search code examples
pythonbddpython-behave

unable to install Behave


I am trying to install Behave in my system for BDD practice in Python. While installing it I am getting below error. I have installed GIT. Please help me out.

Collecting git+https://github.com/behave/behave Cloning https://github.com/behave/behave to c:\users\admin\appdata\local\temp\pip-req-build-_zprf4rz ERROR: Error [WinError 2] The system cannot find the file specified while executing command git version ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?


Solution

  • The error shows that it can't find the command git, and that you might not have it referenced in your PATH. So it is possible that you have it installed, but your system can't find it.

    To fix this error, you will need to set the GIT installation directory path to Windows Environment Variables.

    1. Left-click on the Windows Start Menu and Click on the gear icon to open windows settings.
    2. In the “Windows Settings” window, search for "System Environment Variable".
    3. Now select "Edit the system environment variables".
    4. Next, click the "Environment Variables" button at the bottom-right on the System Properties dialog box.
    5. Double-click on the "Path" entry under "System variables". If you wish to do it for yourself then double click on the “Path” entry under your User.
    6. Next, click on "New" button and add the following two paths C:\Program Files\Git\bin\ and C:\Program Files\Git\cmd\ to the end of the list.
    7. Close all open windows
    8. Finally, close and re-open your PowerShell or Command Prompt to reload Path variables.