Pythonインストール枕グラフィックス処理ライブラリ

Python3.9には独自のグラフィックス処理ライブラリ
がないため、ライブラリPillowをインストールする必要があります

pip install Pillow

次のコマンドを使用するには

from PIL import Image

システムにはいくつかのバージョンのpythonがあります。指定されたバージョン

アップグレードするには、デフォルト設定コマンドpythonは2.7、python3は3.9です。
最初のステップはpipをアップグレードすることであり、
pipは頻繁にアップグレードされます。

python3 -m pip install --upgrade pip

pipを使用してライブラリをインストールします

python2 -m pip install ***
python3 -m pip install ***

デフォルトでは国内の供給元から枕を設置しないでください

python3 -m pip install pillow

国内の情報源を使用して枕を設置する

python3 -m pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple/

国内ソースの選択

1)阿里云 http://mirrors.aliyun.com/pypi/simple/2)豆瓣http://pypi.douban.com/simple/3)清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/4)中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/5)华中科技大学http://pypi.hustunique.com/

インストールリストを表示
デフォルトのPython

pip list

表示するPythonのバージョンを指定します

python3 -m pip list

現在のPillowバージョンまで
Pillow8.1.2

最初はPILライブラリがあると思っていたのですが、
ないことがわかりました。
エラーの例を以下に示します。

[dalaojun@localhost python语言程序设计13]$ python3 -m pip install PIL
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement PIL
ERROR: No matching distribution found for PIL

おすすめ

転載: blog.csdn.net/weixin_47021806/article/details/115049079