경로에 gitpython을 추가하는 방법

경로에 gitpython을 추가하는 방법

Linux에 gitpython 모듈을 설치했습니다. 가져오려고 하면 다음 오류가 발생합니다.

>>> import git
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/git/__init__.py", line 82, in <module                                                                                                                                                             >
    refresh()
  File "/usr/lib64/python2.7/site-packages/git/__init__.py", line 73, in refresh
    if not Git.refresh(path=path):
  File "/usr/lib64/python2.7/site-packages/git/cmd.py", line 292, in refresh
    raise ImportError(err)
ImportError: Bad git executable.
The git executable must be specified in one of the following ways:
    - be included in your $PATH
    - be set via $GIT_PYTHON_GIT_EXECUTABLE
    - explicitly set via git.refresh()

All git commands will error until this is rectified.

This initial warning can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
    - quiet|q|silence|s|none|n|0: for no warning or exception
    - warn|w|warning|1: for a printed warning
    - error|e|raise|r|2: for a raised exception

Example:
    export GIT_PYTHON_REFRESH=quiet

내가 찾은

>>> git.__file__
'/usr/lib64/python2.7/site-packages/git/__init__.pyc'

.profile에 추가해 보았습니다.

~처럼

$GIT_PYTHON_GIT_EXECUTABLE=/usr/lib64/python2.7/site-packages/git/__init__.py

하지만 작동하지 않습니다. 제안해주세요.

관련 정보