TBC/scripts/ensure_requests.py
d-robotics 633a797226 AutoFlow v2.0: 合并 Test (Robogo) + data-loop-automation (D-Cloud) 为统一平台
- 16 个业务模块,856 个测试用例,40 个 E2E 测试
- 单一 React 19 前端 + PlatformSwitcher 二合一切换
- Flask 后端支持 scenario/dcloud_module/dcloud_e2e/dcloud_all 四种任务类型
- E2E 测试面板:API 全链路(8条) + UI 点击(3条) + 分步测试(3个)
- SSE 实时日志流 + 飞书告警 + 定时调度
- 完整还原原 ToB 平台 TestPanel E2E 模块
2026-06-23 11:48:29 +08:00

26 lines
847 B
Python

import subprocess
import sys
import os
print(f"Python executable: {sys.executable}")
print(f"Current working directory: {os.getcwd()}")
try:
import requests
print(f"Requests is already installed: {requests.__version__}")
except ImportError:
print("Requests is NOT installed. Attempting installation...")
try:
# Use full path to pip in the same venv
pip_path = os.path.join(os.path.dirname(sys.executable), 'pip')
print(f"Using pip at: {pip_path}")
result = subprocess.run([pip_path, "install", "requests"], capture_output=True, text=True)
print("STDOUT:", result.stdout)
print("STDERR:", result.stderr)
import requests
print(f"Successfully installed requests: {requests.__version__}")
except Exception as e:
print(f"Installation failed: {e}")