【发布时间】:2018-05-09 22:36:16
【问题描述】:
运行 keras 代码时出现此错误,因此 keras 正在尝试导入
从 PIL 导入图像为 pil_image
我已经安装了枕头,我也可以在我的 python 终端中成功导入它,但是在 jupyter notebook 中它给出了导入错误。
env - aws ec2 实例上的 ubuntu 16,我在 ubuntu 上使用 aws 深度学习 ami
枕头自带conda,我也试过用pip安装
但我可以在 python/ipython shell 中导入它,但不能在 jupyter notebook 中导入。
【问题讨论】:
-
多写一点你的环境。操作系统、Python、Jupyter 包。如果您有多个 Python 安装。你是如何安装枕头的(也许是在虚拟环境中?)。安装了 PIP (pillow.readthedocs.io/en/3.0.x/installation.html),也许是 conda (anaconda.org/anaconda/pillow)?虽然我记得,“大”Anaconda 包装盒中配有开箱即用的枕头。
-
已编辑.. 谢谢
-
我曾经遇到过 Jupyter 的一个错误,它从未指向正确的环境。用户
import sys和print(sys.executable)查看您的 jupyter 正在运行哪个 python。也许您应该卸载 jupyter 并在正确的环境中通过 conda 安装它。或者直接使用conda install jupyter将其安装在正确的环境中。
标签: keras jupyter-notebook pillow