Note that installation of mysql-connector-python failed from pip on Mac
$ pip search mysql
mysql-connector-python (2.0.4) - MySQL driver written in Python
#I thought I could install it because it came out after searching
$ pip install mysql-connector-python==2.0.4
Collecting mysql-connector-python==2.0.4
Could not find a version that satisfies the requirement mysql-connector-python==2.0.4 (from versions: )
No matching distribution found for mysql-connector-python==2.0.4
#I got an error because it was in the search results but it was not prepared for Mac.
#Same even if the version is not specified
#It may depend on the version of Python you are deploying.(I am python2.7.Confirm at 10)
There was a person who had a similar clogging, so if you imitate it, it will disappear smoothly (Reference: StackOverFlow --How do you install mysql-connector-python)
$ git clone https://github.com/mysql/mysql-connector-python.git
$ cd mysql-connector-python
$ python ./setup.py build
$ sudo python ./setup.py install
$ python
>>> import mysql.connector as msc
>>> msc.__version__
'2.1.3'
Recommended Posts