# 以管理员身份打开PowerShell
wsl --install
# 启用WSL功能
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
# 启用虚拟机平台
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
# 下载并安装WSL2内核更新包
# 重启电脑
# 设置WSL2为默认版本
wsl --set-default-version 2
# 安装Ubuntu
wsl --install -d Ubuntu
wsl --list --verbose
# 应该看到:Ubuntu Running version 2
| 命令 | 功能 |
|---|---|
hermes --version |
查看版本 |
hermes --help |
查看帮助 |
hermes setup |
初始化配置向导 |
hermes chat |
进入对话模式 |
hermes chat "问题" |
单次对话 |
hermes config list |
查看所有配置 |
hermes config set key value |
设置配置项 |
hermes config get key |
获取配置项 |
| 命令 | 功能 |
|---|---|
hermes model list |
查看所有可用模型 |
hermes model set provider |
设置默认模型提供商 |
hermes model set model-name |
设置默认模型 |
| 命令 | 功能 |
|---|---|
hermes skills list |
查看所有Skill |
hermes skills list --installed |
查看已安装Skill |
hermes skills search 关键词 |
搜索Skill |
hermes skills install skill-name |
安装Skill |
hermes skills uninstall skill-name |
卸载Skill |
hermes skills info skill-name |
查看Skill详情 |
| 命令 | 功能 |
|---|---|
pwd |
查看当前目录 |
ls -la |
列出所有文件 |
cd 目录名 |
切换目录 |
mkdir 目录名 |
创建目录 |
rm 文件名 |
删除文件 |
rm -rf 目录名 |
删除目录(小心!) |
cat 文件名 |
查看文件内容 |
nano 文件名 |
编辑文件 |
python --version |
查看Python版本 |
pip list |
查看已安装Python包 |
| 命令 | 功能 |
|---|---|
git --version |
查看Git版本 |
git clone 仓库地址 |
克隆代码仓库 |
git status |
查看状态 |
git add 文件名 |
添加文件 |
git commit -m "消息" |
提交 |
git push |
推送 |
git pull |
拉取 |
A: 尝试以下方法:
方法1:用国内源
pip install hermes-agent -i https://pypi.tuna.tsinghua.edu.cn/simple
方法2:升级pip
pip install --upgrade pip
pip install hermes-agent
方法3:用--user安装
pip install hermes-agent --user
A: 原因是Python的bin目录不在PATH里
解决方法:
Linux/macOS:
# 把以下内容加到 ~/.bashrc 或 ~/.zshrc
export PATH="$HOME/.local/bin:$PATH"
# 然后刷新
source ~/.bashrc # 或 source ~/.zshrc
Windows (WSL2):
# 在WSL终端执行
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
验证:
which python
which pip
# 确认路径正确
A: 要求Python 3.10+
检查版本:
python --version
python3 --version
如果版本不够:
Ubuntu/WSL2:
sudo apt update
sudo apt install python3.10 python3.10-pip
python3.10 -m pip install hermes-agent
macOS:
brew install python@3.10
A: 检查以下几点:
测试命令:
curl https://api.deepseek.com/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"
如果返回401,说明Key有问题;如果超时,说明网络问题。
A: 配置代理(如果你有代理的话)
# 临时配置
export HTTP_PROXY=http://127.0.0.1:7890
export HTTPS_PROXY=http://127.0.0.1:7890
# 永久配置(加到 ~/.bashrc)
echo 'export HTTP_PROXY=http://127.0.0.1:7890' >> ~/.bashrc
echo 'export HTTPS_PROXY=http://127.0.0.1:7890' >> ~/.bashrc
或者在Hermes配置里设置:
hermes config set proxy http://127.0.0.1:7890
A: 检查网络,或者手动安装:
# 方法1:重试(可能是网络波动)
hermes skills install skill-name
# 方法2:查看详细错误
hermes skills install skill-name --debug
A: 确保对话中明确提到Skill名称:
❌ 错误:"帮我设计一个功能"
✅ 正确:"使用brainstorming skill帮我设计一个功能"
A: 检查:
A: 微信机器人常见问题:
A: 按 Ctrl+C 中断,或者:
# 另开一个终端,杀死进程
pkill -f hermes
A: 删除配置目录:
# 注意:这会删除所有配置!
rm -rf ~/.hermes
# 然后重新初始化
hermes setup
A: WSL2可以直接访问Windows文件
# Windows的C盘在 /mnt/c/
cd /mnt/c/Users/你的用户名/Desktop
ls
# 把文件复制到Windows桌面
cp 文件名 /mnt/c/Users/你的用户名/Desktop/
保存为 setup-wsl.sh:
#!/bin/bash
# WSL2环境一键配置脚本
echo "=== 开始配置WSL2环境 ==="
# 更新系统
echo "[1/5] 更新系统软件包..."
sudo apt update && sudo apt upgrade -y
# 安装基础工具
echo "[2/5] 安装基础工具..."
sudo apt install -y git curl wget vim nano build-essential
# 安装Python
echo "[3/5] 安装Python 3.10..."
sudo apt install -y python3.10 python3.10-pip python3.10-venv
# 配置pip源
echo "[4/5] 配置pip国内源..."
mkdir -p ~/.config/pip
cat > ~/.config/pip/pip.conf << EOF
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn
EOF
# 安装Hermes
echo "[5/5] 安装Hermes Agent..."
pip install hermes-agent --user
# 配置PATH
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
echo ""
echo "=== 配置完成 ==="
echo "请执行:source ~/.bashrc"
echo "然后执行:hermes --version 验证安装"
echo "然后执行:hermes setup 进行初始化配置"
使用方法:
chmod +x setup-wsl.sh
./setup-wsl.sh
如果在培训中遇到问题,或者有改进建议,欢迎反馈!
培训师联系方式:
- 邮箱:xxx@example.com
- 微信:xxxxxx
祝学习愉快!🚀