# 没有名为“users”的表

- **ID:** `python/sqlalchemy-exc-no-such-table-error`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

数据库不包含预期的表，通常是因为未运行迁移或表从未创建。

## 版本兼容性

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

## 解决方案

1. **Create tables via metadata** (95% 成功率)
   ```
   Run migrations using Alembic or call Base.metadata.create_all(engine) to create all tables defined in models.
   ```
2. **Verify database path** (85% 成功率)
   ```
   Check the database file path and ensure it points to the correct location where tables exist.
   ```

## 无效尝试

- **Creating table manually with SQL** —  (60% 失败率)
- **Restarting the app only** —  (80% 失败率)
