Debian Buster: ModuleNotFoundError: No module named 'mysql'

^Bart gabriele1NOSPAM at hotmail.com
Sat Jan 18 12:20:58 EST 2020


> pip is probably defaulting to Python 2.7. Try using pip3, or this more
> explicit syntax:

Now it works!

Python 3.7.3 (default, Apr  3 2019, 05:39:12)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license()" for more information.
 >>>
========== RESTART: /home/gabriele/Corso_4.0/Python/Test_MySQL2.py 
==========
<mysql.connector.connection.MySQLConnection object at 0x7f20f16799e8>
 >>>

I solved the "issue" by:

# aptitude install python3-pip

$ python3 -m pip install mysql-connector

$ python3 -m pip search mysql-connector | grep --color 
mysql-connector-python

$ python3 -m pip install mysql-connector-python-rf

# aptitude install python3-mysqldb

^Bart


More information about the Python-list mailing list