Bench command fails like this

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py”, line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py”, line 2793, in load_entry_point
return ep.load()
File “/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py”, line 2411, in load
return self.resolve()
File “/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py”, line 2417, in resolve
module = import(self.module_name, fromlist=[‘name’], level=0)
File “/home/ubuntu/bench-repo/bench/cli.py”, line 4, in
from bench.app import get_apps
File “/home/ubuntu/bench-repo/bench/app.py”, line 15, in
import git
File “/usr/local/lib/python3.6/dist-packages/git/init.py”, line 38, in
from git.exc import * # @NoMove @IgnorePep8
File “/usr/local/lib/python3.6/dist-packages/git/exc.py”, line 9, in
from git.compat import UnicodeMixin, safe_decode, string_types
File “/usr/local/lib/python3.6/dist-packages/git/compat.py”, line 16, in
from gitdb.utils.compat import (

Which version of bench and frappe do you use?

Unfortunately I am not able to issue even bench --version, for that matter any bench command to know the version. It gives the same error.

The final lines of the error trace are the most informative so please provide the full error output.

I got the solution for this from here: ModuleNotFoundError: No module named 'gitdb.utils.compat' - #6 by netmanthan