安装问题
安装 Hermes Agent 时可能会遇到各种环境问题。本页涵盖最常见的安装故障及其解决方案。
Python 版本不兼容
Section titled “Python 版本不兼容”症状: 安装时报 SyntaxError 或提示 Python 版本不支持。
原因: Hermes Agent 需要 Python 3.10 或更高版本。
解决方案:
# 检查当前 Python 版本python3 --version
# 如果版本低于 3.10,需要升级Ubuntu / Debian 升级 Python
Section titled “Ubuntu / Debian 升级 Python”sudo add-apt-repository ppa:deadsnakes/ppasudo apt updatesudo apt install python3.11 python3.11-venv python3.11-dev
# 设置为默认版本sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1macOS 升级 Python
Section titled “macOS 升级 Python”使用 uv 管理 Python
Section titled “使用 uv 管理 Python”# uv 会自动安装正确版本的 Pythoncurl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash症状: pip install 时报依赖版本冲突错误。
原因: 系统 Python 环境中已安装的包与 Hermes Agent 的依赖不兼容。
解决方案:
# 方法 1:使用虚拟环境(推荐)python3 -m venv ~/.hermes-venvsource ~/.hermes-venv/bin/activatepip install hermes-agent
# 方法 2:使用一键安装脚本(自动处理虚拟环境)curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
# 方法 3:强制重装pip install --force-reinstall hermes-agent
# 方法 4:使用 uv 替代 pip(更快的依赖解析)pip install uvuv pip install hermes-agent症状: 安装时报 Permission denied 或 [Errno 13]。
原因: 尝试安装到系统级 Python 目录但没有足够权限。
解决方案:
# ❌ 不要用 sudo 安装# sudo pip install hermes-agent
# ✅ 方法 1:使用 --user 标志pip install --user hermes-agent
# ✅ 方法 2:使用虚拟环境python3 -m venv myenvsource myenv/bin/activatepip install hermes-agent
# ✅ 方法 3:修复 ~/.hermes 目录权限sudo chown -R $(whoami):$(whoami) ~/.hermes网络超时或下载失败
Section titled “网络超时或下载失败”症状: 安装时无法下载包或连接超时。
原因: 网络问题,特别是在中国大陆访问 PyPI 可能较慢。
解决方案:
# 方法 1:使用国内镜像pip install hermes-agent -i https://pypi.tuna.tsinghua.edu.cn/simple
# 方法 2:使用 Hermes 国内镜像安装脚本curl -fsSL https://res1.hermesagent.org.cn/install.sh | bash
# 方法 3:设置 pip 永久使用镜像pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# 方法 4:设置代理export HTTPS_PROXY=http://127.0.0.1:7890pip install hermes-agentGit 克隆失败
Section titled “Git 克隆失败”症状: git clone 超时或连接被拒绝。
原因: GitHub 访问受限。
解决方案:
# 方法 1:使用 GitHub 镜像git clone https://ghproxy.com/https://github.com/NousResearch/hermes-agent.git
# 方法 2:配置 Git 代理git config --global http.proxy http://127.0.0.1:7890git config --global https.proxy http://127.0.0.1:7890
# 方法 3:直接下载 zip 包wget https://github.com/NousResearch/hermes-agent/archive/refs/heads/main.zipunzip main.zipcd hermes-agent-mainpip install -e .WSL2 特有问题
Section titled “WSL2 特有问题”症状: 在 WSL2 中安装时遇到特殊错误。
常见问题与解决方案:
# 问题 1:WSL2 中缺少编译工具sudo apt update && sudo apt install -y build-essential python3-dev
# 问题 2:文件系统性能差(跨 Windows/Linux 文件系统)# 不要在 /mnt/c/ 下安装,改用 Linux 原生文件系统cd ~git clone https://github.com/NousResearch/hermes-agent.git
# 问题 3:DNS 解析失败echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.confDocker 安装问题
Section titled “Docker 安装问题”症状: Docker 拉取镜像失败。
解决方案:
# 方法 1:使用国内 Docker 镜像源docker pull registry.cn-hangzhou.aliyuncs.com/nousresearch/hermes-agent:latest
# 方法 2:配置 Docker 代理mkdir -p /etc/systemd/system/docker.service.dcat > /etc/systemd/system/docker.service.d/proxy.conf << EOF[Service]Environment="HTTPS_PROXY=http://127.0.0.1:7890"EOFsudo systemctl daemon-reloadsudo systemctl restart docker
# 方法 3:手动导入# 在有网络的机器上导出镜像docker save nousresearch/hermes-agent:latest -o hermes-agent.tar# 传输到目标机器后导入docker load -i hermes-agent.taruv 安装失败
Section titled “uv 安装失败”症状: 一键安装脚本中 uv 安装失败。
解决方案:
# 手动安装 uvcurl -fsSL https://astral.sh/uv/install.sh | sh
# 或使用 pip 安装pip install uv
# 然后重新运行 Hermes 安装脚本curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash安装完成后,运行以下命令验证一切正常:
hermes --version # 确认版本号hermes doctor # 全面诊断如果 hermes doctor 全部显示 ✅,说明安装成功。
完整重装流程
Section titled “完整重装流程”如果以上方案都无法解决,可以尝试完全重装:
# 1. 备份重要数据cp -r ~/.hermes ~/.hermes.backup
# 2. 清除旧安装pip uninstall hermes-agentrm -rf ~/.hermes-agentrm -rf ~/.hermes-venv
# 3. 重新安装curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
# 4. 恢复数据cp -r ~/.hermes.backup/memory ~/.hermes/cp -r ~/.hermes.backup/skills ~/.hermes/- 常见错误 — 运行时的常见错误
- 模型问题 — LLM 配置相关故障
- hermes doctor 诊断 — 自动诊断工具
- Linux 安装 — 详细安装指南