The version of Python is
$ python --version
Python 2.7.12
The error code is as follows
importmysql.connector
The error message is
ImportError:Nomodulenamedmysql.connector
The driver installed at the beginning is that the installation was successful
$ pipinstallmysql-connector
But if you install MySQL connector python, you will report an error
Collecting mysql-connector-python
Could not find a version that satisfies the requirement mysql-connector-python (from versions: ) No matching distribution found for mysql-connector-python
So now the driver is MySQL connector instead of MySQL connector Python
ask for help from an experienced friend
The problem has been solved
The steps are as follows:
Execute PIP search MySQL connector | grep -- color MySQL connector Python
The output is like this
mysql-connector-python-rf (2.1.3) - MySQL driver written in Python mysql-connector-python (2.0.4) - MySQL driver written in Python
Usepip install mysql-connector-python-rf==2.1.3
is ok
Similar Posts:
- ImportError: No module named mysql
- Troubleshooting MySQL Python error on MAC
- [How to Solve] ImportError: No module named MySQLdb
- Error in installing MySQL Python on MAC [Solved]
- IDEA Connect MYSQL Error: You have an error in your SQL syntax : ‘OPTION SQL_SELECT_LIMIT=1000’ (or…
- Solve the problem of pychart connecting MySQL 1366 and reporting an error
- Java.lang.classnotfoundexception: com.mysql.cj.jdbc.driver can’t find jar package, path problem
- There is no solution of. Net framework data provider for MySQL in data provider
- How to Solve Django Error: No module named ‘MySQLdb’