Skip to content

docs(wechat): use agent-reach interpreter for miku_ai search example#188

Merged
Panniantong merged 1 commit intomainfrom
fix/wechat-skill-python-interpreter
Mar 23, 2026
Merged

docs(wechat): use agent-reach interpreter for miku_ai search example#188
Panniantong merged 1 commit intomainfrom
fix/wechat-skill-python-interpreter

Conversation

@Panniantong
Copy link
Owner

Problem

Fixes #187

miku_ai is installed inside the agent-reach Python environment (via pipx inject or pip install into the same venv). When users install agent-reach via pipx (the recommended method in docs/install.md), the system python3 is a different interpreter — it cannot import miku_ai, causing ModuleNotFoundError.

The SKILL.md search example used bare python3 -c ..., which silently breaks for pipx users.

Fix

Detect the correct interpreter at runtime:

AGENT_REACH_PYTHON=$(python3 -c "import agent_reach, sys; print(sys.executable)" 2>/dev/null || echo python3)

This resolves correctly for all install methods:

  • pipx: resolves to ~/.local/share/pipx/venvs/agent-reach/bin/python
  • venv: resolves to the venv's python
  • plain pip / system install: falls back to python3 (same as before)

No hardcoded paths; no new dependencies.

Verification

  • python3 -m pytest tests/ -x -q49 passed
  • Diff: 1 file, 7 lines changed (SKILL.md only)

miku_ai is installed inside the agent-reach Python environment (pipx venv
or user venv). Using bare 'python3' fails when agent-reach was installed
via pipx, because system python3 cannot import miku_ai.

Fix: detect the correct interpreter at runtime via:
  $(python3 -c "import agent_reach, sys; print(sys.executable)")

This resolves the interpreter transparently for pipx, venv, and plain pip
installs without hardcoding paths.

Closes #187
@Panniantong Panniantong merged commit e640650 into main Mar 23, 2026
8 checks passed
@Panniantong Panniantong deleted the fix/wechat-skill-python-interpreter branch March 23, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

文档不一致:install.md 推荐 pipx 安装,但 SKILL.md 微信搜索示例使用系统 python3 调用 miku_ai

1 participant