Spaces:
Running
Running
fix: use --user flag for pip install (non-root container)
Browse filesContainer 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>
- 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 (
|
| 787 |
-
subprocess.run(
|
| 788 |
-
|
| 789 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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}")
|