2087721266 发表于 2020-9-1 18:00:41

输入 pip install Pillow安装 PIL 第三方库还是无法识别.jpg格式

还是无法识别.jpg格式
>>> g.buttonbox('大家说我长得帅吗?', image=r'C:\Users\sjk\Pictures\Saved Pictures\1.jpg', choices=('帅', '不帅', '!@#$%'))
Cannot load C:\Users\sjk\Pictures\Saved Pictures\1.jpg.Check to make sure it is an image file.
PIL library isn't installed.If it isn't installed, only .gif files can be used.

可以识别.png格式
g.buttonbox('大家说我长得帅吗?', image=r'C:\Users\sjk\Pictures\Saved Pictures\2.png', choices=('帅', '不帅', '!@#$%'))


这是我的安装步骤
C:\Users\sjk>pip install Pillow -i https://pypi.tuna.tsinghua.edu.cn/simple
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting Pillow
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/9c/f0/00f71c1a52859f8f1b82ed6bc2bf5890321511b642c01242d38df02bb5d0/Pillow-7.2.0-cp38-cp38-win32.whl (1.8 MB)
   |████████████████████████████████| 1.8 MB 3.3 MB/s
Installing collected packages: Pillow
Successfully installed Pillow-7.2.0

C:\Users\sjk>python -m pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: pillow in d:\program files (x86)\python\lib\site-packages (7.2.0)

C:\Users\sjk>

为什么安装 了PIL 还是无法识别.jpg格式?是我安装的有问题还是少输入了什么命令?新手求助{:10_266:}

疾风怪盗 发表于 2020-9-1 19:51:56

放源代码,应该是能读jpg的

2087721266 发表于 2020-9-1 20:13:03

把idle重启之后就可以了,一脸懵逼
页: [1]
查看完整版本: 输入 pip install Pillow安装 PIL 第三方库还是无法识别.jpg格式