windows下python3.8安装PIL:python3.8缺少Image库

windows下python3.8安装PIL:python3.8缺少Image库

python官网:
https://www.python.org/

python3.8运行使用了Image库的python脚本

运行.py脚本,报错:
Traceback (most recent call last):
File “CutPngToTga.py”, line 32, in
import PIL.Image
ModuleNotFoundError: No module named ‘PIL’

这是因为,安装的python还没有包含PIL模块

python安装PIL:
进入windows的cmd:

1.更新pip
(1)查看pip版本
pip --version
(2)更新pip
python -m pip install --upgrade pip

2.安装python的PIL(python图形库)
pip install Pillow

3.python应用导入PIL
python代码中导入Image库的一种方式:
import PIL.Image

你可能感兴趣的:(Python,Python,PIL,Image库)