Python on Mac: 无法安装图像模块
Python on Mac: Image module cannot be installed
我正在使用 Mac 并尝试安装用于加载图像的图像包(示例:How do I read an image file using Python?)。
我正在使用 anaconda 和 PyCharm。 python 版本是 2.7.10.
如果我尝试:pip install Image
,它显示:
Requirement already satisfied (use --upgrade to upgrade): Image in ./lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): pillow in ./lib/python2.7/site-packages (from Image)
Requirement already satisfied (use --upgrade to upgrade): django in ./lib/python2.7/site-packages (from Image)
但是当我加载它时,它显示 "no module named Image"。
我也尝试从 PyCharm 安装,但我无法从包搜索中找到 Image
(我可以找到 "image",但似乎是不同的)。
这会给你你想要的吗:
from PIL import Image
您需要安装 Python 图像库 (PIL)。鉴于您正在使用 conda:
$ conda install pil
然后,来自python:
from PIL import Image
我正在使用 Mac 并尝试安装用于加载图像的图像包(示例:How do I read an image file using Python?)。
我正在使用 anaconda 和 PyCharm。 python 版本是 2.7.10.
如果我尝试:pip install Image
,它显示:
Requirement already satisfied (use --upgrade to upgrade): Image in ./lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): pillow in ./lib/python2.7/site-packages (from Image)
Requirement already satisfied (use --upgrade to upgrade): django in ./lib/python2.7/site-packages (from Image)
但是当我加载它时,它显示 "no module named Image"。
我也尝试从 PyCharm 安装,但我无法从包搜索中找到 Image
(我可以找到 "image",但似乎是不同的)。
这会给你你想要的吗:
from PIL import Image
您需要安装 Python 图像库 (PIL)。鉴于您正在使用 conda:
$ conda install pil
然后,来自python:
from PIL import Image