(rag) PS F:\bigmodelcourse\JkaiProject> python .\demo_1.py
Traceback (most recent call last):
  File "E:\miniconda3\envs\rag\lib\site-packages\git\__init__.py", line 296, in <module>
    refresh()
  File "E:\miniconda3\envs\rag\lib\site-packages\git\__init__.py", line 287, in refresh
    if not Git.refresh(path=path):
  File "E:\miniconda3\envs\rag\lib\site-packages\git\cmd.py", line 860, 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(<full-path-to-git-executable>)
All git commands will error until this is rectified.
This initial message 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|silent|none|n|0: for no message or exception
    - warn|w|warning|log|l|1: for a warning message (logging level CRITICAL, displayed by default)
    - error|e|exception|raise|r|2: for a raised exception
Example:
    export GIT_PYTHON_REFRESH=quiet
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "F:\bigmodelcourse\JkaiProject\demo_1.py", line 13, in <module>
    from ragas import evaluate
  File "E:\miniconda3\envs\rag\lib\site-packages\ragas\__init__.py", line 6, in <module>
    from ragas.experiment import Experiment, experiment, version_experiment
  File "E:\miniconda3\envs\rag\lib\site-packages\ragas\experiment.py", line 9, in <module>
    import git
  File "E:\miniconda3\envs\rag\lib\site-packages\git\__init__.py", line 298, in <module>
    raise ImportError("Failed to initialize: {0}".format(_exc)) from _exc
ImportError: Failed to initialize: Bad git executable.
The git executable must be specified in one of the following ways:
    - be included in your $PATH
    - explicitly set via git.refresh(<full-path-to-git-executable>)
All git commands will error until this is rectified.
This initial message 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|silent|none|n|0: for no message or exception
    - warn|w|warning|log|l|1: for a warning message (logging level CRITICAL, displayed by default)
    - error|e|exception|raise|r|2: for a raised exception
Example:
    export GIT_PYTHON_REFRESH=quiet
最开始报以上错误,我在代码中添加以下代码:
os.environ['GIT_PYTHON_REFRESH'] = 'quiet'
但是运行成功,参数是NA
