Python is an amateur who made a tool when Python3 was just released, but I was addicted to building an environment at work and could not refer to mysql-connector from python3, so I made a note.
In the environment where python (2.7.x) and python3 (3.4.x) are installed, there was mysql-connector-python in pip list, but it does not exist in pip3 list and it seems that it can not be referenced from python3 did.
If it is not in pip3, you can install it with pip3 ...
Console
$ sudo pip3 install mysql-connector-python
Cannot install with the following error
Could not find a version that satisfies the requirement mysql-connector-python (from versions: )
No matching distribution found for mysql-connector-python
Is this for python (2.x), pip?
pip3 search mysql-connector
What is displayed in ...?
With pip3 search, I installed the following that appeared in the line immediately below.
Console
$ sudo pip3 install mysql-connector-python-rf
I was able to install this without any problems. I don't know what rf is, but it seemed to be prepared by another name.
There are some posts from people who are having trouble on stackoverflow.com, and I was able to solve it by following the steps below.
Console
$ echo https://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.1.3.tar.gz >> requirements.txt
$ sudo pip3 install -r ./requirements.txt
cf. http://stackoverflow.com/questions/34489271/i-cannot-install-mysql-connector-python-using-pip
When I was involved in the environment construction, Flask + SQLAlchemy + MySQL environment construction was not successful.
Recommended Posts