日志核心:403 Forbidden 访问清华 PyPI 镜像下载 blinker 包被拒绝

exit status 2、failed to init environment。docker-compose.yml 或 .envapi/.env在 .env 新增环境变量:
PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/ PIP_TRUSTED_HOST=mirrors.aliyun.com # 备选官方源 # PIP_INDEX_URL=https://pypi.org/simple
docker compose down && docker compose up -d
重启后重新安装 Ollama 插件,pip 会走阿里云源,规避清华 403 拦截。
docker exec -it dify-api bash
mkdir -p ~/.pip cat > ~/.pip/pip.conf <
pip download blinker==1.9.0 -d ./wheels -i https://mirrors.aliyun.com/pypi/simple
/app/storage/cwd/langgenius/ollama-xxx/pip install *.whl --no-index --find-links=.
插件依赖安装容易出 pip 网络问题,可绕过插件:
http://host.docker.internal:11434(Docker 部署)或宿主机 IP;重新安装插件,日志不再出现 https://pypi.tuna.tsinghua.edu.cn 链接,全部走阿里云 mirrors 域名,无 403 报错即修复完成。
配置安装成功后,注意如果要在dify是部署在docker中的话,
ollama的地址要写为http://host.docker.internal:11434