【问题标题】:Can import TensorFlow and Keras in Jupyter, even though I have them installed?可以在 Jupyter 中导入 TensorFlow 和 Keras,即使我已经安装了它们?
【发布时间】:2017-12-12 23:56:10
【问题描述】:

我已经在 Mac OS 上设置了 Tensorflow 和 Keras。我也有 Jupyter,它是我的 Anaconda 安装的一部分。

当我尝试在 Jupyter 笔记本中导入 Tensoflow 或 Keras 时,我收到“没有名为 <...> 的模块”错误。

我错过了一步吗?

【问题讨论】:

    标签: python tensorflow keras jupyter-notebook


    【解决方案1】:

    改变你的环境。您可能在 tensorflow 环境中安装了所有内容,但在根目录上运行了笔记本。

    The window you want to check

    【讨论】:

      【解决方案2】:

      如果您是使用 Jupyter 笔记本的 Windows/Mac 用户,pip install keras 对您没有帮助。相反,请尝试以下步骤:

      1. 在命令提示符下导航到安装的 anaconda 的“站点包”目录。
      2. 现在使用conda install tensorflowconda install keras 之后
      3. 重新启动 Jupyter 笔记本并运行包。

      【讨论】: