python - 导入错误 : No module named PIL

我在shell中使用这个命令来安装PIL:

easy_install PIL

然后我运行 python 并输入:import PIL。但我得到这个错误:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
ImportError: No module named PIL

我从来没有遇到过这样的问题,你觉得呢?

最佳答案

在 shell 中,运行:

pip install Pillow

注意:PIL 已弃用,pillow是继任者。

https://stackoverflow.com/questions/8863917/

相关文章:

python - 为什么 Python 中的 @foo.setter 对我不起作用?

linux - 如何删除 "Argument list too long"时超过 3 天的所有文件?

http - Wget 将文档和标题输出到 STDOUT

c - Linux内核如何编译自己?

python - 如何在 Python 中将 RGB 图像转换为灰度图像?

linux - 如何计算包括子目录在内的代码行数

python - TypeError : sequence item 0: expected str

python - 检测和排除 pandas DataFrame 中的异常值

linux - tcpdump:本地主机到本地主机

python - 你如何在已经创建的 virtualenv 中设置你的 pythonpath?