1
0

More than 1 year has passed since last update.

【Python】パーフェクトPython・イメージ(pypng) packageを使用できるまでの手順

Last updated at Posted at 2022-03-11

背景

第18章のマルチメディアトピックにおいて、pypng packageの活用を紹介していますが、事前にインストールが必要な項目があるので、それを整理していく。
なお、Python3.5以上でないとpypngは利用できない。

環境情報

PC : Macbook Pro - Apple M1 - macOS Montery
環境 : pyenv 2.2.4
Python : 3.8.12

手順

以下の手順を踏んで必要なファイルを作成していく。

mkdir [フォルダ名]
cd [フォルダ名]
pip install pypng
# セットアップツールを作成するために、以下の2つのファイルを作成する。空ファイルでOK。ディレクトリは、同じところで問題ありません。

touch pyproject.toml
touch setup.cfg


# 以下のコマンドを実行して、build/UNKNOWN.egg-infoフォルダが作成される
pip install .

# png.pyファイルを作成して、pngをimportできるようにする。
curl -LO https://raw.github.com/drj11/pypng/main/code/png.py

以上のプロセスを踏むとpypng packageを利用できます。

参考資料

pypng - PyPI

1
0
1

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
1
0