【问题标题】:tensorflow is not working in jupyter notebooktensorflow 在 jupyter notebook 中不起作用
【发布时间】:2018-08-04 16:55:40
【问题描述】:

我是 Anaconda 的初学者。我正在使用 jupyter 笔记本。 Tensorflow 正在处理 anaconda 提示符,但未在 jupyter notebook 中打开。如何解决这个问题。请帮帮我。我是初学者。 enter image description here

【问题讨论】:

标签: python tensorflow anaconda jupyter-notebook


【解决方案1】:

您使用 tensorflow 创建了一个环境,但没有在其中安装 jupyter-notebook。您需要在安装 tensorflow 的同一环境中安装 notebook:

在 Windows 上,您需要从 anaconda 命令行激活安装 tensorflow 的环境(在您发布的图片中,它似乎被称为 tensorflow)。然后在那里安装它。在anaconda命令行中执行以下命令来实现,然后在tensorflow的环境下启动notebook

(base) C:\Users\usr>activate tensorflow
(tensorflow) C:\Users\usr>conda install jupyter
(tensorflow) C:\Users\usr>jupyter-notebook

这应该可以解决您的问题。

【讨论】:

    【解决方案2】:

    Jupyter notebook 中的 python 内核指向根内核。如果您需要在 Jupyter 笔记本中显示特定环境,请执行以下操作

    # Creating a custom environment in anaconda prompt with python 3.6
    (base)C:\>conda create -n MyEnvironment python=3.6
    (base)C:\>activate MyEnvironment 
    # Install your custom pacakges like tensorflow etc
    (MyEnvironment)C:\>pip install tensorflow
    (MyEnvironment)C:\>python -m ipykernel install --name MyEnvironment
    (MyEnvironment)C:\>jupyter notebook
    

    现在您应该能够在 Jupyter notebook 中看到根内核和 MyEnvironment 内核版本

    【讨论】:

      猜你喜欢
      • 2017-06-12
      • 1970-01-01
      • 2018-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多