Skip to content

Import Error on Linux #711

Open
Open
@cookiestuf

Description

@cookiestuf

gitpython version: 2.1.8
git version: 1.8.3.1
python version: 2.7.5

I'm using REL7. This is not an issue in REL6 (not sure if I should post here or somewhere else...)

To reproduce on REL7:

  • create repo in your home dir with 700 permissions
  • cd $repo
  • sudo -u $someotheruser python -c "import git"
    here, someotheruser is not able to read $repo

I get this error: `Traceback (most recent call last):

  File "<string>", 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 293, 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions