# OSError: [Errno 98] 地址已被占用

- **ID:** `python/flask-debug-reloader-port-in-use`
- **领域:** python
- **类别:** system_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

之前的 Flask 开发服务器（或重载器子进程）仍占用该端口，导致新进程无法绑定。

## 版本兼容性

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

## 解决方案

1. **** (95% 成功率)
   ```
   lsof -ti:5000 | xargs kill -9
   ```
2. **** (90% 成功率)
   ```
   app.run(port=5001)
   ```

## 无效尝试

- **** — Only avoids the second process; the original is still bound. (80% 失败率)
- **** — Does not free the port held by the old process. (85% 失败率)
