# sqlalchemy.exc.NoSuchModuleError：无法加载插件：sqlalchemy.dialects:postgresql

- **ID:** `python/sqlalchemy-no-engine-found`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

缺少或配置错误的数据库驱动程序（例如，未安装 psycopg2）。

## 版本兼容性

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

## 解决方案

1. **Install the correct driver.** (95% 成功率)
   ```
   pip install psycopg2-binary
   ```
2. **Use correct connection string format.** (90% 成功率)
   ```
   engine = create_engine('postgresql://user:pass@localhost/dbname')
   ```

## 无效尝试

- **Installing wrong package like 'postgresql' instead of 'psycopg2-binary'.** — SQLAlchemy requires specific driver packages; generic packages don't work. (70% 失败率)
- **Setting incorrect dialect string like 'postgres' instead of 'postgresql'.** — Dialect names are case-sensitive and must match exactly. (80% 失败率)
