麒麟 V10 内网环境下 Dify 插件离线安装全流程
本文记录了在 x86_64 麒麟 V10 内网环境中安装 Dify 插件的过程,从日志排查问题,到离线打包插件,确保可以在内网环境下正常运行。特别加入了 Python 版本核查与官方 vs plus 工具差异。
1. 背景环境
- 操作系统:麒麟 V10 x86_64
- Dify 部署:Docker + plugin-daemon 0.4.1
- 内网环境:无法直接访问外网 pypi.org
- 问题插件:
junjiem/mcp_sse:0.2.3 - 工具:官方
dify-plugin-repackaging(注意:不要用dify-plugin-repackaging-plus,它可能在 Python ≥3.11 下报语法错误) - Python 并存:
- 系统默认 Python3.9
- 手动安装 Python3.11
目标:在内网环境下成功安装插件,并解决依赖 gevent==24.11.1 与 Python 版本不兼容问题。
2. 核查 Python 版本
在打包插件之前,必须确认 Python 环境。
2.1 系统默认 Python
python3 --version # 输出示例 Python 3.9.23
2.2 手动安装 Python3.11
which python3.11 whereis python3.11 /usr/bin/python3.11 --version # 输出示例 Python 3.11.13
2.3 升级 pip(建议在 Python3.11 下操作)
/usr/bin/python3.11 -m ensurepip --upgrade /usr/bin/python3.11 -m pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple/
注意:内网环境可指定
-i国内镜像脚本最好使用官方dify-plugin-repackaging,不要用 plus 版本,否则会报SyntaxError: unmatched ')'
3. 麒麟 V10 日志排查插件安装问题
查看 plugin-daemon 日志:
docker logs -f dify-plugin_daemon-1
示例日志:
[INFO]init environment for plugin junjiem/mcp_sse:0.2.3 [ERROR]init environment failed: failed to install dependencies: exit status 1, output: × No solution found when resolving dependencies: ╰─▶ Because gevent== == available, we can conclude that gevent== cannot be used.

