gemini-cli - 💡(How to fix) Fix /model set gemini-2.5-pro --persist is not working as expected [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#25108Fetched 2026-04-11 06:31:33
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×1unlabeled ×1

Root Cause

✦ The previous command failed because the python executable was not found. It's likely that the correct command is python3. I will now try running the script using python3.

RAW_BUFFERClick to expand / collapse

Procedure:

  • Set a default model via configuration and use a command without specifying the model flag.
  1. Run /model set gemini-2.5-pro --persist
  2. Run gemini generate "Short prompt"

`

/model set gemini-2.5-pro --persist

ℹ Model set to gemini-2.5-pro (persisted)

gemini generate "Short prompt"

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ ✓ Ask User │ │ │ │ User answered: │ │ Clarification → a function to add 2 numbers │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ ✓ Ask User │ │ │ │ User answered: │ │ Language → Python │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ ✓ WriteFile Writing to main.py │ │ │ │ 1 def add_numbers(a, b): │ │ 2 """ │ │ 3 This function adds two numbers and returns the result. │ │ 4 """ │ │ 5 return a + b │ │ 6 │ │ 7 # Example usage: │ │ 8 result = add_numbers(5, 3) │ │ 9 print(f"The sum is: {result}") │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

✦ I have created the main.py file containing the Python function to add two numbers. Now, I will run the file to demonstrate that it works.

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ ✓ Shell python main.py [current working directory /Users/nithyanandan/1.49_Testing253_Files2] (Running the python script to show the output of the add_numbers function.) │ │ │ │ exec: "python": executable file not found in $PATH │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

✦ The previous command failed because the python executable was not found. It's likely that the correct command is python3. I will now try running the script using python3.

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ ✓ Shell python3 main.py [current working directory /Users/nithyanandan/1.49_Testing253_Files2] (Running the python script with python3 to show the output of the add_numbers function.) │ │ │ │ The sum is: 8 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

✦ I have created the main.py file and successfully run it using python3. The output shows that the add_numbers function is working correctly. The task is now complete.

which model was used to generate the above code ✦ I am a large language model, trained by Google. which model was used to generate this code ✦ As a large language model trained by Google, I don't have a specific model name or version that I can share. I am part of a larger system that is continuously updated.

`

<img width="1470" height="921" alt="Image" src="https://github.com/user-attachments/assets/eafee2c4-eb42-4b29-8b17-eb47f3bae21e" />

extent analysis

TL;DR

The issue can be resolved by using the correct Python executable, which is python3, to run the generated Python script.

Guidance

  • The error message "executable file not found in $PATH" indicates that the system cannot find the python executable, suggesting that python3 should be used instead.
  • The correct command to run the Python script is python3 main.py.
  • The generated code is a Python function to add two numbers, and it works correctly when run with python3.
  • The model used to generate the code is not explicitly stated, but it is mentioned that it is a large language model trained by Google.

Example

# Example usage of the generated add_numbers function
result = add_numbers(5, 3)
print(f"The sum is: {result}")

Notes

  • The issue is specific to the system's Python configuration, and the solution is to use the correct executable.
  • The generated code is a simple Python function and does not require any modifications.

Recommendation

Apply workaround: Use python3 instead of python to run the generated Python script, as the system does not have the python executable in its PATH.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING