tao-shen Claude Opus 4.6 commited on
Commit
5c981dd
·
1 Parent(s): f532fc8

fix: use --user flag for pip install (non-root container)

Browse files

Container runs as node user, not root. pip install without --user
can't write to system site-packages. Also log pip result for debugging.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. scripts/sync_hf.py +9 -4
scripts/sync_hf.py CHANGED
@@ -783,10 +783,15 @@ def main():
783
  """Launch conversation-loop with auto-restart on crash."""
784
  nonlocal conv_loop_proc
785
  time.sleep(60) # let OpenClaw fully initialize
786
- # Ensure requests is installed (may be missing from Docker image)
787
- subprocess.run([sys.executable, "-m", "pip", "install", "-q",
788
- "--break-system-packages", "requests"],
789
- capture_output=True, timeout=60)
 
 
 
 
 
790
  script = os.path.join(os.path.dirname(__file__), "conversation-loop.py")
791
  if not os.path.exists(script):
792
  print(f"[SYNC] conversation-loop.py not found at {script}")
 
783
  """Launch conversation-loop with auto-restart on crash."""
784
  nonlocal conv_loop_proc
785
  time.sleep(60) # let OpenClaw fully initialize
786
+ # Ensure requests is installed (runs as non-root user node)
787
+ pip_result = subprocess.run(
788
+ [sys.executable, "-m", "pip", "install", "--user",
789
+ "--break-system-packages", "requests"],
790
+ capture_output=True, text=True, timeout=120)
791
+ if pip_result.returncode != 0:
792
+ print(f"[SYNC] pip install requests failed: {pip_result.stderr[:200]}")
793
+ else:
794
+ print("[SYNC] pip install requests OK")
795
  script = os.path.join(os.path.dirname(__file__), "conversation-loop.py")
796
  if not os.path.exists(script):
797
  print(f"[SYNC] conversation-loop.py not found at {script}")