
import zipfile, os, glob
target = '/workspace/.local/lib/python3.11/site-packages'
os.makedirs(target, exist_ok=True)
wheels = sorted(glob.glob('/workspace/tmp_wheels/*.whl'))
print(f'找到 {len(wheels)} 个 wheel 文件')
for whl in wheels:
    name = os.path.basename(whl)
    print(f'安装 {name}...')
    try:
        with zipfile.ZipFile(whl, 'r') as z:
            z.extractall(target)
        print('  -> 成功')
    except Exception as e:
        print(f'  -> 失败: {e}')
print('安装完成')

