Como adicionar o gitpython ao caminho

0

Eu instalei o módulo gitpython no linux. Ao tentar importá-lo, recebo o seguinte erro.

>>> 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

Eu encontrei

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

Eu tentei adicionar isso ao .profile

como

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

mas não funciona, por favor sugira

    
por user3399495 10.05.2018 / 09:08

0 respostas

Tags