# 警告：位于 myrepo.local 的仓库不是受信任或安全的主机，已被忽略。如果此仓库可通过 HTTPS 访问，我们建议您改用 HTTPS，否则您可以使用 '--trusted-host myrepo.local' 来消除此警告并允许它。
错误：找不到满足 mypkg 要求的版本

- **ID:** `python/pip-index-url-http-insecure`
- **领域:** python
- **类别:** network_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

除非主机被明确标记为受信任，否则 pip 拒绝使用 HTTP（非 TLS）索引。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   pip install --index-url http://myrepo.local/simple --trusted-host myrepo.local mypkg
   ```
2. **** (90% 成功率)
   ```
   # ~/.config/pip/pip.conf
[global]
index-url = http://myrepo.local/simple
trusted-host = myrepo.local
   ```

## 无效尝试

- **** — HTTP index is still rejected without --trusted-host. (90% 失败率)
- **** — Environment variable changes the index but not the trust decision. (85% 失败率)
- **** — Cache does not affect trust evaluation of the index host. (95% 失败率)
