问题
I'm very new to mySQL and just installed it on my Mac (OS 10.6.8). When I try to connect with the database through Terminal, I get this message:
Last login: Tue Jun 17 10:42:23 on console mysqluc -e "help utilities" GEdit-2:~ Eric$ mysqluc -e "help utilities" Traceback (most recent call last): File "/bin/mysqluc", line 23, in from mysql.utilities.common.options import license_callback, UtilitiesParser File "/Library/Python/2.6/site-packages/mysql/utilities/common/options.py", line 35, in from mysql.connector.conversion import MySQLConverter ImportError: No module named connector.conversion
After reading in this and other forums, I installed:
mySQL-connector-python 1.2.2
I also added this path:
PATH=/usr/local/git/bin:/usr/local/mysql/bin:$PATH
But, nothing has helped.
I have also tried to install:
mySQL-connector-odbc 5.3.2
but, the installation fails.
Any help would be greatly appreciated.
Eric
回答1:
From Can't run MySql Utilities:
MYSQL Utilities assumes that the MySQL Connector for Python has been installed. If you install it (http://dev.mysql.com/downloads/connector/python/), MySQL Utilities should run OK.
回答2:
I tried solving this for hours and ended up using the mysqldb library instead of mysql-connector for python. (Using Mac osSierra 10.12) It was enough for my purposes though I can't ensure that it would be enough for everybodies purposes.
回答3:
I had the same problem. Searching on Internet I met the solution. We have to install the library given by Python:
sudo apt-get install python3-mysql.connector
Or, if Python 2:
sudo apt-get install python-mysql.connector
Thanks to: https://askubuntu.com/questions/1014947/mysql-connector-python-importerror-no-module-named-mysql
回答4:
MySQL connector is required...but it seems this version is bugging out and not installing on Mac OSmysql-connector-python-8.0.15-macos10.14.dmg
.
If someone is having the same problem, you can install pymysql instead, as this post suggests.
来源:https://stackoverflow.com/questions/24267017/importerror-no-module-named-connector-conversion