LoginSignup
2
3

More than 5 years have passed since last update.

Pythonでデータ操作をするための環境準備

Posted at

Created by Kenneth Kim on Feb 20, 2019

データ操作の自動化を図るため、Pythonによるプログラミングをしようとする。
データベースはMySQL、編集はExcelを想定する。
MySQLインストール時にPythonのインストールが求められ、Pythonを入れるが、バージョンは3.7.*が必要になる。よって、下記のステップで、Python、MySQLをインストールする。また、Excel操作に必要なパッケージ(openpyxl)をインストールする。

■ PC環境

  • Window 10 (64bit)
  • インターネット接続

■ 手順

  1. Pythonをインストールする
    https://www.python.org/downloads/windows/
    Python 3.7.2 - 2018-12-24
    Download Windows x86 executable installer

  2. 環境変数にPythonのパスを通しておく
    Path
    C:\Users\{UserName}\AppData\Local\Programs\Python\Python37\

  3. Pythonのインストール結果を確認する
    > python -V

    Python 3.7.2

  4. MySQLをインストール
    https://dev.mysql.com/downloads/windows/installer/8.0.html
    mysql-installer-community-8.0.15.0.msi

  5. mysql-connector-pythonがインストールされたかを確認する
    > python -m pip list

    mysql-connector-python 8.0.15

  6. ついでにpipをアップグレードする
    > python -m pip install --upgrade pip

  7. PythonでExcelを操作するためのパッケージopenpyxlをインストールする
    > python -m pip install openpyxl

  8. openpyxlのインストール結果を確認する
    >python -m pip list

    et-xmlfile 1.0.1
    jdcal 1.4
    openpyxl 2.6.0

以上で環境の準備が完了した。

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3