From b679bcb24f6c70785ab5d7ec551ba62a5dd77a2d Mon Sep 17 00:00:00 2001 From: iomgaa Date: Sat, 18 Jul 2026 03:28:13 -0400 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20setup=5Fremote.sh=EF=BC=9A?= =?UTF-8?q?=E5=BC=83=E7=94=A8=20conda=20run=EF=BC=88=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E6=95=B4=E4=BD=93=E7=BC=93=E5=86=B2=EF=BC=89=EF=BC=8C=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E7=9B=B4=E8=B0=83=E7=8E=AF=E5=A2=83=E5=86=85=20pip/py?= =?UTF-8?q?thon=20=E5=AE=9E=E7=8E=B0=E5=AE=9E=E6=97=B6=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- scripts/setup_remote.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/setup_remote.sh b/scripts/setup_remote.sh index 701a844..e7333cd 100755 --- a/scripts/setup_remote.sh +++ b/scripts/setup_remote.sh @@ -29,7 +29,8 @@ else fi # ---- 3. 依赖 ---- -conda run -p "$ENV_PATH" pip install -r "$REPO_DIR/requirements.txt" -r "$REPO_DIR/requirements-remote.txt" +# 直接调环境内 pip:conda run 会整体缓冲子命令输出(违反"日志实时可查"规矩),弃用 +"$ENV_PATH/bin/pip" install -r "$REPO_DIR/requirements.txt" -r "$REPO_DIR/requirements-remote.txt" # ---- 4. 环境变量持久化(写入 ~/.bashrc,幂等)---- if ! grep -q "ars-opd-rebuild env" ~/.bashrc; then @@ -46,9 +47,9 @@ fi # ---- 5. 验证 ---- echo "=== 验证 torch/CUDA ===" -conda run -p "$ENV_PATH" python -c "import torch; print('torch', torch.__version__, '| cuda可用:', torch.cuda.is_available(), '| 卡数:', torch.cuda.device_count())" +"$ENV_PATH/bin/python" -c "import torch; print('torch', torch.__version__, '| cuda可用:', torch.cuda.is_available(), '| 卡数:', torch.cuda.device_count())" echo "=== 验证单元测试 ===" -conda run -p "$ENV_PATH" python -m pytest "$REPO_DIR/tests" -q +"$ENV_PATH/bin/python" -m pytest "$REPO_DIR/tests" -q echo "=== 磁盘检查(根分区不应有明显增长)===" df -h / /data | tail -2 echo "全部完成。日常使用:输入 opd 进入环境与目录。"