Python错误:AttributeError:__enter__此处

时间:2019-12-12 18:29:21

标签: python tensorflow matplotlib keras virtualenv

I = mpimg.imread(FACE_INPUT_PATH + picname)
I_np = np.array(I)
Traceback (most recent call last):
    File "pretrain_load_test.py", line 67, in <module>
        I = mpimg.imread(FACE_INPUT_PATH + picname)
    File "/home/avicky/env/lib/python3.7/site-packages/matplotlib/image.py", 
        line 1417, in imread
            with Image.open(fname) as image:
    AttributeError: __enter__

1 个答案:

答案 0 :(得分:0)

尝试更新您的库,似乎版本冲突

pip install -U pillow