Tries to use Python when only Python3 available

Resolved 💬 4 comments Opened Nov 24, 2025 by aehlke Closed Nov 26, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.63.0

What subscription do you have?

Pro

Which model were you using?

gpt-5.1-codex-max high

What platform is your computer?

macOS 26.1

What issue are you seeing?

On macOS I think normally and not only in my system, I have python3 but no python.

I often get:

• Ran python - <<'PY'
  │ import re, pathlib
  │ text=pathlib.Path('Vendor/LakeOfFire/Sources/LakeOfFire/Reader/ReaderModeViewModel.swift').read_text()
  │ … +3 lines
  └ zsh:1: command not found: python

• Ran python3 - <<'PY'
[...]

Which wastes precious context

What steps can reproduce the bug?

Get it to make file edits with Python

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

4 Comments

github-actions[bot] contributor · 9 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #6070

Powered by Codex Action

lionel-oai contributor · 9 months ago

Hi @aehlke, I think you can either try:

  • to add "Use python3 executable to run python" at the end of your prompt
  • or source a virtual environment prior to running codex so that python is available
aehlke · 9 months ago
Hi @aehlke, I think you can either try: - to add "Use python3 executable to run python" at the end of your prompt - or source a virtual environment prior to running codex so that python is available

Thanks. I agree these should work but if these are needed for ALL macOS users then I think it's a Codex bug, not something all users should figure out on their own. It could be solved in a variety of ways within Codex.

lionel-oai contributor · 9 months ago

Added clear guidance in the docs on sourcing your environment before running codex, closing this issue.