不知道是什么原因造成的...
我正在使用“Pillow-3.3.0.win32-py34.exe”安装文件运行 Python 3.4.3。
在导入图像时
from PIL import Image
我尝试使用将“a.jpg”设置为我的图像
img = Image.open("a.jpg")
但是我得到这个错误,
>>> img = Image.open("a.jpg")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python34\lib\site-packages\PIL\Image.py", line 2289, in open
preinit()
File "C:\Python34\lib\site-packages\PIL\Image.py", line 365, in preinit
from PIL import JpegImagePlugin
File "C:\Python34\lib\site-packages\PIL\JpegImagePlugin.py", line 40, in <modu
le>
from PIL import Image, ImageFile, TiffImagePlugin, _binary
File "C:\Python34\lib\site-packages\PIL\TiffImagePlugin.py", line 50, in <modu
le>
from fractions import Fraction
File "C:\Python34\lib\fractions.py", line 6, in <module>
from decimal import Decimal
File "C:\Python34\lib\decimal.py", line 3855, in <module>
_numbers.Number.register(Decimal)
AttributeError: 'module' object has no attribute 'Number'
可能与 Pillow 无关,但仍然非常感谢帮助!
最佳答案
关于pillow - 属性错误 : 'module' object has no attribute 'Number' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38703637/