ImportError:无法导入加载图像文件所需的Python映像库(PIL)

2024-05-16 00:22:23 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试运行facemorpher 1.0.1python包中的average.py程序。我已经创建了一个虚拟环境,其中openCV安装了homebrew,python 2.7安装了homebrew,可执行的frameworkpython在虚拟环境中构建了一个python框架cv

运行average程序当前会提供此输出。

(cv) Francess-MacBook-Pro-2:face_morpher Megan$ frameworkpython facemorpher/averager.py --images=IMFDB_final/Ali/HelloBrother/images --out=average.png
Traceback (most recent call last):
File "facemorpher/averager.py", line 94, in <module>
    args['--out'], args['--plot'])
File "facemorpher/averager.py", line 61, in averager
    img, points = load_image_points(path, size)
File "facemorpher/averager.py", line 46, in load_image_points
    img = scipy.ndimage.imread(path)[..., :3]
 File "/Users/Megan/.virtualenvs/cv/lib/python2.7/site-packages/scipy/ndimage/io.py", line 25, in imread
raise ImportError("Could not import the Python Imaging Library (PIL)"
ImportError: Could not import the Python Imaging Library (PIL) required to load image files.  Please refer to http://pypi.python.org/pypi/PIL/ for installation instructions.

我可以安装枕头来修复这个错误吗?我应该在哪里安装我的枕头或枕头路径来修复这个错误?


Tags: inpyimage程序pilline虚拟环境load