无法从Pylab导入Imread

时间:2019-12-23 12:52:54

标签: python matplotlib anaconda importerror

import numpy as np
import pandas as pd
import cv2
from matplotlib import pyplot as plt
from pylab import imread
from skimage.color import rgb2gray
from PIL import Image
from skimage import feature

我重新安装了Windows 10,因此也不得不重新安装Anaconda和Jupyter。

我通常使用这些import语句,但是现在出现错误:

  

ImportError:无法从“ pylab”导入名称“ imread”   (C:\ Users \ DELL \ Anaconda3 \ lib \ site-packages \ pylab__init __。py)

您有什么建议吗?我已经安装了Pylab,PIL和Matplotlib。

1 个答案:

答案 0 :(得分:0)

尝试添加:

from matplotlib.pyplot import imread

代替:

from pylab import imread