I am having a python script like below in a file git.py
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from git import Repo
git_path = "test"
repo = Repo(git_path)
assert not repo.bare
Python version is : Python 2.7.12
OS : Description: Ubuntu 16.04.1 LTS
Gitpython - 2.1.7
I am getting the below error when i run python git.py
Traceback (most recent call last):
File "git.py", line 4, in <module>
from git import Repo
File "/home/user/demo_files/git.py", line 4, in <module>
from git import Repo
ImportError: cannot import name Repo
I have checked most of the links ,available not able to resolve my issue. Please help me.
git.py.