Discussion:
Problem using mysql library
(too old to reply)
Tobiah
2024-07-09 13:17:32 UTC
Permalink
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
Stefan Ram
2024-07-09 14:02:32 UTC
Permalink
Post by Tobiah
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.

Loading...