# ImportError: 无法从部分初始化的模块'app.routes'导入名称'bp'（最可能的原因是循环导入）

- **ID:** `python/flask-circular-import-blueprint`
- **领域:** python
- **类别:** module_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

两个模块相互导入，通常是app -> routes -> app以获取app对象或注册蓝图。

## 版本兼容性

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

## 解决方案

1. **** (93% 成功率)
   ```
   def create_app():\n    app = Flask(__name__)\n    from .routes import bp\n    app.register_blueprint(bp)\n    return app
   ```
2. **** (88% 成功率)
   ```
   def register():\n    from .routes import bp\n    app.register_blueprint(bp)
   ```

## 无效尝试

- **** — Still executed at import time; cycle remains. (65% 失败率)
- **** — Cycle is structural, not naming. (90% 失败率)
