hermes - 💡(How to fix) Fix Desktop app crashes on macOS: findSystemPython() picks Python 3.9 from /usr/bin, fails on str | None syntax

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…

Error Message

the default on macOS). The error occurs because hermes_cli/main.py uses PEP 604 type union syntax (str | None) Error

Root Cause

The Hermes Desktop app crashes on macOS when the system Python at /usr/bin/python3 is version 3.9.x (which is
the default on macOS). The error occurs because hermes_cli/main.py uses PEP 604 type union syntax (str | None)
which requires Python 3.10+.
Error

Fix Action

Fix / Workaround

  • OS: macOS (Apple Silicon)
    • Hermes version: latest (installed via DMG)
    • System Python: /usr/bin/python3 = 3.9.6
    • User Python: /usr/local/bin/python3 = 3.14.5
      Workaround
RAW_BUFFERClick to expand / collapse

Body:
Description

 The Hermes Desktop app crashes on macOS when the system Python at /usr/bin/python3 is version 3.9.x (which is      
 the default on macOS). The error occurs because hermes_cli/main.py uses PEP 604 type union syntax (str | None)     
 which requires Python 3.10+.                                                                                       
 Error                                                                                                              
                                                                                                                    
 [hermes] [boot] Using installed hermes_cli module via /usr/bin/python3                                             
 [hermes] File "/Users/.../.hermes/hermes-agent/hermes_cli/main.py", line 207, in <module>                          
 [hermes] def _read_openai_version_fast() -> str | None:TypeError: unsupported operand type(s) for : 'type' and     
 'NoneType'                                                                                                         
 [hermes] Hermes backend exited (1).                                                                                
                                                                                                                    
 Root Cause                                                                                                         
                                                                                                                    
 In apps/desktop/electron/main.cjs, the findSystemPython() function on POSIX systems does a simple PATH lookup:     
                                                                                                                    
 js                                                                                                                 
 function findSystemPython() {                                                                                      
   if (!IS_WINDOWS) {                                                                                               
     for (const command of ['python3', 'python']) {                                                                 
       const candidate = findOnPath(command)                                                                        
       if (candidate) return candidate                                                                              
     }                                                                                                              
     return null                                                                                                    
   }                                                                                                                
   // ...Windows has version filtering (SUPPORTED_VERSIONS = ['3.11', '3.12', '3.13'])                              
 }                                                                                                                  
                                                                                                                    
 When launched from Finder/Dock (not terminal), macOS gives GUI apps a minimal PATH where /usr/bin comes before     
 /usr/local/bin. So /usr/bin/python3 (Python 3.9.6) is found first, even though /usr/local/bin/python3 (3.14.5)     
 or /opt/homebrew/bin/python3 is available.                                                                         
                                                                                                                    
 The Windows branch already filters by SUPPORTED_VERSIONS = ['3.11', '3.12', '3.13'], but the POSIX branch has      
 no version check at all.                                                                                           
 Suggested Fix                                                                                                      
                                                                                                                    
 Add Python version checking on POSIX similar to Windows. The findSystemPython() function should:                   
                                                                                                                    
 1. Check well-known macOS locations (/usr/local/bin, /opt/homebrew/bin) in addition to PATH                        
 2. Verify the candidate Python is >= 3.10 before returning it                                                      
 3. Fall through to bootstrap if no suitable Python is found                                                        
                                                                                                                    
 js                                                                                                                 
 function isPythonAtLeast310(pythonPath) {                                                                          
   try {                                                                                                            
     const { execFileSync } = require('child_process')                                                              
     const out = execFileSync(pythonPath, [                                                                         
       '-c', 'import sys; print(".".join(map(str, sys.version_info[:2])))'                                          
     ], { timeout: 5000, stdio: ['pipe', 'pipe', 'pipe'] }).toString().trim()                                       
     const [major, minor] = out.split('.').map(Number)                                                              
     return major > 3 || (major === 3 && minor >= 10)                                                               
   } catch { return false }                                                                                         
 }                                                                                                                  
                                                                                                                    
 Environment                                                                                                        
                                                                                                                    
 - OS: macOS (Apple Silicon)                                                                                        
 - Hermes version: latest (installed via DMG)                                                                       
 - System Python: /usr/bin/python3 = 3.9.6                                                                          
 - User Python: /usr/local/bin/python3 = 3.14.5                                                                     
 Workaround                                                                                                         
                                                                                                                    
 Launch from terminal with corrected PATH:                                                                          
 bash                                                                                                               
 PATH=/usr/local/bin:$PATH open ~/.hermes/hermes-agent/apps/desktop/release/mac-arm64/Hermes.app

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