安装指南¶
本指南将帮助你在不同平台上安装 CDNBestIP。
系统要求¶
- Python 版本: Python 3.13 或更高
- 操作系统: Windows, Linux, macOS
- 依赖: CloudflareSpeedTest v2.3.4+
安装方法¶
方法 1: 使用 pip (推荐)¶
最简单的安装方式是通过 PyPI:
方法 2: 使用 uv¶
uv 是一个快速的 Python 包管理器:
# 安装 uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# 使用 uv 安装 cdnbestip
uv tool install cdnbestip
方法 3: 从源码安装¶
如果你需要最新的开发版本:
# 使用 pip
pip install git+https://github.com/idev-sig/cdnbestip.git
# 使用 uv
uv tool install git+https://github.com/idev-sig/cdnbestip.git
# 指定版本
uv tool install git+https://github.com/idev-sig/cdnbestip.git@v0.1.0
方法 4: Docker¶
使用 Docker 无需安装 Python 环境:
# 拉取镜像
docker pull idevsig/cdnbestip:latest
# 或从其他镜像仓库
docker pull ghcr.io/idev-sig/cdnbestip:latest
平台特定安装¶
Linux¶
macOS¶
Windows¶
- 从 python.org 下载并安装 Python 3.13+
- 打开命令提示符或 PowerShell
- 运行安装命令:
验证安装¶
安装完成后,验证是否成功:
预期输出:
升级¶
升级到最新版本¶
升级到特定版本¶
卸载¶
故障排除¶
问题 1: Python 版本不兼容¶
错误信息:
解决方案: 升级到 Python 3.13 或更高版本。
问题 2: 权限错误¶
错误信息:
解决方案:
使用 --user 标志安装到用户目录:
问题 3: 网络问题¶
错误信息:
解决方案: 使用国内镜像源:
问题 4: 依赖冲突¶
解决方案: 创建虚拟环境:
# 创建虚拟环境
python -m venv cdnbestip_env
# 激活虚拟环境
source cdnbestip_env/bin/activate # Linux/macOS
cdnbestip_env\Scripts\activate # Windows
# 安装
pip install cdnbestip
下一步¶
安装完成后,继续阅读 快速入门 了解如何使用 CDNBestIP。