ultralytics icon indicating copy to clipboard operation
ultralytics copied to clipboard

ImportError: Failed to initialize: Bad git executable.

Open evia1 opened this issue 2 years ago • 0 comments

Search before asking

  • [X] I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

Other

Bug

Hi

Im getting this error when i try to import YOLO from ultralytics:

from ultralytics import YOLO

Output:

ImportError: Failed to initialize: 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

This only happens when I import ultralytics, doesn't happen when I import any other library.

Thanks for help!

Environment

  • YOLOv8,
  • Win10
  • Python 3.9.13 (main, Aug 25 2022, 23:51:50) [MSC v.1916 64 bit (AMD64)]

Minimal Reproducible Example

from ultralytics import YOLO

Additional

No response

Are you willing to submit a PR?

  • [ ] Yes I'd like to help by submitting a PR!

evia1 avatar Jan 21 '23 07:01 evia1