✅ 优点:
- 完全开源,代码透明
- 数据100%本地,隐私安全
- 架构清晰,可深度定制
- 社区活跃,更新快
- 长期演进有保障
⚠️ 缺点:
- 需要一定技术基础
- 需要自己配置环境
✅ 优点:
- 开箱即用
- 无需维护环境
- 集成丰富
- 界面友好
⚠️ 缺点:
- 数据在第三方服务器
- 定制能力有限
- 成本随用量上涨
- 被平台锁定
✅ 优点:
- 深度集成开发环境
- 编程能力强
- 开发者体验好
⚠️ 缺点:
- 主要面向开发者
- 非编程场景能力一般
- 成本较高
✅ 优点:
- 界面好看
- 上手简单
⚠️ 缺点:
- ⚠️ 绝大多数都不成熟
- 功能阉割
- 更新滞后于官方
- 安全隐患(可能偷API Key)
- 无社区支持
C:\ vs / 各种不兼容方法A:命令行安装(推荐)
以管理员身份打开PowerShell,执行:
wsl --install
方法B:手动启用
1. 打开「控制面板」→「程序和功能」
2. 点击「启用或关闭Windows功能」
3. 勾选「适用于Linux的Windows子系统」和「虚拟机平台」
4. 重启电脑
📸 截图位置1:Microsoft Store搜索Ubuntu的界面
在Ubuntu终端输入:
lsb_release -a
预期输出:
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy
# 查看WSL版本
wsl -l -v
# 设置默认版本为WSL2
wsl --set-default-version 2
# 进入WSL
wsl
# 关机(遇到问题时)
wsl --shutdown
# 查看磁盘占用
wsl --df
Windows 主机
↓
WSL2 虚拟机
↓
真正的 Ubuntu / Debian
↓
完美的开发环境
✅ 所有Linux工具直接用
✅ 没有路径问题
✅ 没有权限问题
✅ 性能接近原生Linux
✅ Windows文件互通:/mnt/c/ 就是Windows的C盘
sudo apt update && sudo apt upgrade -y
sudo apt install -y git python3 python3-pip python3-venv build-essential
git config --global user.name "你的名字"
git config --global user.email "你的邮箱"
解决: 关闭Windows Defender实时保护,或添加排除项
解决: 创建 C:\Users\你的用户名\.wslconfig:
[wsl2]
memory=4GB
processors=4
swap=2GB
解决: 在WSL中操作,不要在Windows里改WSL的文件
code .pip install hermes-agent
# 解决:加--user
pip install hermes-agent --user
# 解决:用清华源
pip install hermes-agent -i https://pypi.tuna.tsinghua.edu.cn/simple
方法1:命令行配置(推荐)
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
方法2:手动创建配置文件
Linux/Mac:~/.pip/pip.conf
Windows:C:\Users\你的用户名\pip\pip.ini
内容:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn
| 源 | 地址 | 速度 |
|---|---|---|
| 清华大学 | https://pypi.tuna.tsinghua.edu.cn/simple | ⭐⭐⭐⭐⭐ |
| 阿里云 | https://mirrors.aliyun.com/pypi/simple/ | ⭐⭐⭐⭐ |
| 豆瓣 | https://pypi.douban.com/simple/ | ⭐⭐⭐ |
| 中科大 | https://pypi.mirrors.ustc.edu.cn/simple/ | ⭐⭐⭐⭐ |
备份原源:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
编辑源文件:
sudo nano /etc/apt/sources.list
替换为清华源(Ubuntu 22.04):
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
更新:
sudo apt update
# 淘宝源
npm config set registry https://registry.npmmirror.com
# 验证
npm config get registry
# 检查版本
python --version
# 要求:3.10+
hermes --version
hermes-agent, version x.y.z
# 解决1:刷新环境变量
source ~/.bashrc # 或 ~/.zshrc
# 解决2:用python -m调用
python -m hermes --version
hermes setup
# 检查版本
python --version
# 要求:3.10+
# 安装依赖
sudo apt install -y git curl build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev
# 安装pyenv
curl https://pyenv.run | bash
# 添加到~/.bashrc(或~/.zshrc)
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
# 刷新配置
source ~/.bashrc
# 安装Python 3.11
pyenv install 3.11.6
# 设置全局默认版本
pyenv global 3.11.6
# 验证
python --version
pyenv versions # 查看已安装版本
pyenv install --list # 查看可安装版本
pyenv local 3.10.12 # 当前目录用特定版本
| 提供商 | 推荐场景 | 输入价格(元/百万token) | 输出价格(元/百万token) |
|---|---|---|---|
| DeepSeek | 代码、推理、新手首选 | 0.7 | 2.8 |
| 字节豆包 | 中文、速度快 | 0.3 | 1.2 |
| 阿里通义千问 | 综合能力均衡 | 0.5 | 2.0 |
| OpenAI GPT-4o | 通用、高质量 | 35 | 105 |
| Claude 3 Opus | 长文本、复杂推理 | 105 | 350 |
📸 截图位置2:DeepSeek控制台创建API Key的界面
hermes config set provider deepseek
hermes config set api_key YOUR_API_KEY
hermes config set provider doubao
hermes config set api_key YOUR_API_KEY
hermes config set model doubao-pro-32k
如果不想用本地部署开源模型:
# 1. 安装Ollama
curl -fsSL https://ollama.com/install.sh | sh
# 2. 下载模型
ollama pull qwen:7b
# 3. 配置Hermes
hermes config set provider ollama
hermes config set model qwen:7b
✅ 完全离线运行,不花一分钱!
# Linux/Mac
export HTTP_PROXY=http://127.0.0.1:7890
export HTTPS_PROXY=http://127.0.0.1:7890
# Windows PowerShell
$env:HTTP_PROXY="http://127.0.0.1:7890"
$env:HTTPS_PROXY="http://127.0.0.1:7890"
添加到 ~/.bashrc 或 ~/.zshrc:
export HTTP_PROXY=http://127.0.0.1:7890
export HTTPS_PROXY=http://127.0.0.1:7890
export NO_PROXY=localhost,127.0.0.1
curl https://www.google.com
# 能访问说明代理生效
~/.hermes/config.yaml
hermes config list
provider: deepseek
api_key: sk-xxxxxxxxxxx
model: deepseek-chat
temperature: 0.7
max_tokens: 2000
hermes chat
你好,请介绍一下你自己
Agent回复,说明安装成功!
# 查看版本
hermes --version
# 查看帮助
hermes --help
# 查看可用模型
hermes model list
# 对话模式
hermes chat
# 单次对话
hermes chat "你好,请讲个笑话"
帮我写一个Python脚本,计算斐波那契数列
错误:Invalid API Key
解决:检查Key是否正确,是否有余额
错误:Connection timeout
解决:检查网络、配置代理
错误:command not found: hermes
解决:确认安装成功,刷新环境变量
pip install hermes-agenthermes setuphermes --version + hermes chat