GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Bad git executable · Issue #1882 · gitpython-developers/GitPython

Bad git executable #1882

New issue
Copy link
New issue
Copy link
Closed as not planned
Bug
Closed as not planned
Bad git executable#1882
Bug
Copy link
Labels
acknowledgedhelp wanted

Description

@haferburg
haferburg
opened on Mar 20, 2024
Issue body actions

This is the full message:

  Traceback (most recent call last):

    File "C:\Users\AHaferbu\.pyenv\pyenv-win\versions\3.9.6\lib\site-packages\git\__init__.py", line 83, in <module>
      refresh()
    File "C:\Users\AHaferbu\.pyenv\pyenv-win\versions\3.9.6\lib\site-packages\git\__init__.py", line 73, in refresh
      if not Git.refresh(path=path):
    File "C:\Users\AHaferbu\.pyenv\pyenv-win\versions\3.9.6\lib\site-packages\git\cmd.py", line 278, 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 error message could be much more helpful.

Which git executable is it trying to run?
Why? Where did it find that path? Is it using the PATH? Is it using GIT_PYTHON_GIT_EXECUTABLE?

Activity

  1. Byron commented on Mar 20, 2024

    @Byron
    Byron
    on Mar 20, 2024
    Member
    More actions

    Thanks for sharing - I agree.

    The code for this is here, in case anyone wants to give it a shot:

    GitPython/git/cmd.py

    Lines 463 to 476 in 64ec0b1

    # Warn or raise exception if test failed.
    if not has_git:
    err = (
    dedent(
    """\
    Bad git executable.
    The git executable must be specified in one of the following ways:
    - be included in your $PATH
    - be set via $%s
    - explicitly set via git.refresh(<full-path-to-git-executable>)
    """
    )
    % cls._git_exec_env_var
    )

  2. Byron
    added
    acknowledged
    help wanted
    on Mar 20, 2024
  3. EliahKagan commented on Apr 1, 2024

    @EliahKagan
    EliahKagan
    on Apr 1, 2024
    Member
    More actions

    This relates to the inconsistency discussed in #1815 (comment) and could be partially fixed by making initial refresh exception and logging messages include the path, as subsequent refresh messages have done since #1812. (I say "partially" because that would still not directly tell the user how that specific git executable path was set or discovered.)

    Reacted by Sebastian Thiel
  4. Byron
    added the
    Bug
    issue type on Jul 20, 2026
  5. Byron
    closed this as not plannedon Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acknowledgedhelp wanted

    Type

    Bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.