PowerPoint(.pptx)ファイルを作成および更新するPythonライブラリ「python-pptx」のインストール

スポンサーリンク

PowerPoint(.pptx)ファイルを作成および更新するPythonライブラリ「python-pptx」のインストールについて解説しています。

「python-pptx(https://github.com/scanny/python-pptx)」は、PowerPointファイルの作成や更新が行なえ、自動化するのに適したライブラリとなっています。

■Python

今回のPythonのバージョンは、「3.6.8」を使用しています。(Windows10)(pythonランチャーでの確認)

■python-pptxをインストールする

python-pptxをインストールを行いますが、今回はpipを経由してインストールを行うので、まずWindowsのコマンドプロンプトを起動します。

pip install python-pptx

起動後、上記のコマンドを入力し、Enterキーを押します。

なお、今回は、pythonランチャーを使用しており、Python Version 3.6.8にインストールを行うために、バージョンの切り替えを行います。

py -3.6 -m pip install python-pptx

切り替えるために、上記のコマンドを入力し、Enterキーを押します。

Defaulting to user installation because normal site-packages is not writeable
Collecting python-pptx
Downloading python-pptx-0.6.21.tar.gz (10.1 MB)
|████████████████████████████████| 10.1 MB 2.2 MB/s
Requirement already satisfied: lxml>=3.1.0 in c:\users\user_\appdata\roaming\python\python36\site-packages (from python-pptx) (4.6.2)
Requirement already satisfied: Pillow>=3.3.2 in c:\users\user_\appdata\roaming\python\python36\site-packages (from python-pptx) (6.2.2)
Collecting XlsxWriter>=0.5.7
Downloading XlsxWriter-3.0.3-py3-none-any.whl (149 kB)
|████████████████████████████████| 149 kB 2.2 MB/s
Building wheels for collected packages: python-pptx
Building wheel for python-pptx (setup.py) ... done
Created wheel for python-pptx: filename=python_pptx-0.6.21-py3-none-any.whl size=470950 sha256=215d49e266069f8f8e5b7ae3fd12a952ede160db17f3b15eaf1a496dc91ba68c
Stored in directory: c:\users\user_\appdata\local\pip\cache\wheelsd\dd\e8bf0aa9fcf74bdfa70200ebcbb42c0753b56be60a6b77e120
Successfully built python-pptx
Installing collected packages: XlsxWriter, python-pptx
Successfully installed XlsxWriter-3.0.3 python-pptx-0.6.21

Enterキーを押すと、インストールが開始され、上記のように「Successfully installed」と表示されます。これが表示されれば、python-pptxが正常にインストールされたことになります。

なお、今回はpython-pptxのバージョン0.6.21をインストールしました。

コメント

タイトルとURLをコピーしました