• Problem using mysql library

    From Tobiah@3:633/280.2 to All on Tue Jul 9 23:17:32 2024
    sinewave:toby ~(1)> python
    Python 2.7.18 (default, Jul 8 2024, 12:49:12)
    [GCC 13.2.0] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    import MySQLdb
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/local/lib/python2.7/site-packages/MySQLdb/__init__.py", line 23, in <module>
    (version_info, _mysql.version_info))
    ImportError: this is MySQLdb version (1, 2, 5, 'final', 1), but _mysql is version (1, 4, 6, 'final', 0)


    I Googled this a lot, and saw many people with the same problem,
    but couldn't find an answer that helped.


    Thanks!


    Toby

    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Stefan Ram@3:633/280.2 to All on Wed Jul 10 00:02:32 2024
    Tobiah <toby@tobiah.org> wrote or quoted:
    ImportError: this is MySQLdb version (1, 2, 5, 'final', 1),
    but _mysql is version (1, 4, 6, 'final', 0)

    It seems these versions must match, but do not match, so the
    first idea would be to uninstall the libraries and then install
    them again explicitly specifying the same version (like "1.2.5")
    for all of them. But I'm not an expert here, and doing this
    might break even more or might not work due to the deprecation of
    Python 2.7, so please proceed with caution and at your own risk.

    --- MBSE BBS v1.0.8.4 (Linux-x86_64)
    * Origin: Stefan Ram (3:633/280.2@fidonet)