3
我只是想尝试一段代码将图像粘贴到另一个上面。那么,我不能再进一步了,因为AttributeError
在进口时正好提出。无法导入PIL图像
from PIL import Image
# image_path = "/Users/me/images/"
# fg_file = "hello-600x600.jpg"
# bg_file = "deer-1.jpg"
#
# bg = Image.open(image_path + bg_file)
# fg = Image.open(image_path + fg_file)
#
# bg.paste(fg, (10, 10), fg)
# bg.show()
随着进口我得到了以下的输出:
Traceback (most recent call last):
File "/Users/me/dev/pyExamples/image_manipulation/merge_images.py", line 3, in <module>
from PIL import Image
File "/Library/Python/2.7/site-packages/PIL/Image.py", line 31, in <module>
import logging
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 206, in <module>
_lock = threading.RLock()
AttributeError: 'module' object has no attribute 'RLock'
Exception AttributeError: '_shutdown' in <module 'threading' from '/Users/me/dev/pyExamples/threading/__init__.pyc'> ignored
Process finished with exit code 1
我似乎来自该方法threading.RLock()
,但我不知道在这里做什么。
什么建议吗?
有趣。 '导入线程'在你的系统上工作吗?怎么样'进口线程;打印threading.RLock'? – Kevin