Cobra Forum

Linux => General Help => Topic started by: mahesh on Oct 12, 2023, 03:49 AM

Title: Upgrade Broke Python?
Post by: mahesh on Oct 12, 2023, 03:49 AM
After upgrading from 18.04 to 20.04, my python2 script which previously ran fine now returns the following:

Traceback (most recent call last):
File "/usr/local/bin/checks.py", line 10, in <module>
import _mysql
ImportError: No module named _mysql


If I run python2 from the command line, I get the following:

Python 2.7.18 (default, Jul 1 2022, 12:27:04)
[GCC 9.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mysql
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named mysql
>>> import _mysql
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named _mysql
>>> import mysql.connector
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named mysql.connector
>>>

Please don't tell me to upgrade to python3. My time on earth is limited. I've already wasted several hours trying to find an answer.