Skip to content

[bug] mysql error while importing #12

@BernieHuang2008

Description

@BernieHuang2008

Describe the bug

During importing the library with from MercurySQL import set_driver, the following error appeared:

In [7]: from MercurySQL import set_driv
   ...: er
---------------------------------------
AttributeErrorTraceback (most recent call last)
Cell In[7], line 1
----> 1 from MercurySQL import set_driver

File /data/data/com.termux/files/usr/lib/python3.11/site-packages/MercurySQL/__init__.py:18
      1 """
      2 MercurySQLite
      3 =============
   (...)
     15 Please refer to the individual class documentation for more details.
     16 """
     17 from .core import DataBase, set_driver
---> 18 from . import drivers

File /data/data/com.termux/files/usr/lib/python3.11/site-packages/MercurySQL/drivers/__init__.py:1
----> 1 from .mysql import Driver_MySQL as mysql
      2 from .sqlite import Driver_SQLite as sqlite

File /data/data/com.termux/files/usr/lib/python3.11/site-packages/MercurySQL/drivers/mysql.py:15
     11 class Driver_MySQL(BaseDriver):
     12     pass
---> 15 class Driver_MySQL(BaseDriver):
     16     """
     17     .. note::
     18         Supported MySQL Version: **8.2**
     19     """
     20     dependencies = ['mysql-connector-python']

File /data/data/com.termux/files/usr/lib/python3.11/site-packages/MercurySQL/drivers/mysql.py:25, in Driver_MySQL()
     22 payload = '%s'
     24 Conn = mysql.connector.MySQLConnection
---> 25 Cursor = mysql.connector.cursor_cext.CMySQLCursor
     27 class APIs:
     28     class gensql:

AttributeError: module 'mysql.connector' has no attribute 'cursor_cext'

How To Reproduce?

  1. from MercurySQL import set_driver

Expected behavior

No bug, and import it successfully

Additional context

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions