Help us understand the problem. What is going on with this article?

macでのmysql-connector-pythonインストール方法

More than 3 years have passed since last update.

Macでpipからmysql-connector-pythonのインストールに失敗したのでメモ

$ pip search mysql
mysql-connector-python (2.0.4)         - MySQL driver written in Python
  # 検索して出てくるからインストールできると思った

$ 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
  # 検索結果にいたのにMac用に用意されていなかったためかエラーに。
  # バージョン未指定でも同様
  # 導入中のPythonのバージョンに依存したものかもしれない。(自分はpython2.7.10で確認)

似たような詰まり方をされている方がいたので、真似っこしたらすんなり解消
(参考: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'
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした