python install_error ai_generated true

sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:mysql.connector

ID: python/sqlalchemy-missing-driver-for-dialect

Also available as: JSON · Markdown · 中文
80%Fix Rate
88%Confidence
0Evidence
2025-06-07First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.x active

Root Cause

The specified MySQL dialect requires a driver that is not installed.

generic

中文

指定的 MySQL 方言需要未安装的驱动。

Workarounds

  1. 95% success
    pip install mysql-connector-python
    engine = create_engine('mysql+mysqlconnector://user:pass@localhost/db')
  2. 90% success
    pip install pymysql
    engine = create_engine('mysql+pymysql://user:pass@localhost/db')

Dead Ends

Common approaches that don't work:

  1. 40% fail

    URL dialect must match installed driver.

  2. 60% fail

    The driver is still missing.