python - 没有名为 tensor flow 的模块——iPython notebook

标签 python machine-learning tensorflow anaconda jupyter-notebook

我知道这可能是一个老问题,但我仍然无法从现成的 Q$A 中找到解决方案。这是问题所在:

我正在学习 Udacity“机器学习”及其作业,需要使用 iPythonNotebook 和 tensorflow。详情:https://github.com/Omarito2412/udacity-deeplearning

作业 2 需要 tensorflow。顺便说一句,我已经安装了 Anaconda, 已经在 Macbook 的同一台计算机上使 tensorflow 在 Pycharm 上运行,但不知道如何使其在 iPythonNotebook 环境下运行。

代码很简单,如下:

import numpy as np
import tensorflow as tf
from six.moves import cPickle as pickle
from six.moves import range

错误信息如下:

ImportError                               Traceback (most recent call last)
<ipython-input-1-0970743dd90d> in <module>()
      2 # before proceeding further.
      3 import numpy as np
----> 4 import tensorflow as tf
      5 from six.moves import cPickle as pickle
      6 from six.moves import range

ImportError: No module named tensorflow

谢谢。有什么建议吗?

PS:我在两台MacBook上都遇到过这个问题,两台MacBook都运行Pycharm+tensorflow。

最佳答案

您应该停用并重新激活环境

source deactivate tensorflow
source activate tensorflow

关于python - 没有名为 tensor flow 的模块——iPython notebook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37756452/

相关文章:

python - Q-Learning Table收敛到-inf

python - 使用 gcloud ML 引擎时如何设置环境变量?

machine-learning - 无论图像如何,Caffe 都会预测相同的类别

TensorFlow Lite : Init node doesn't exist

python - 无法弄清楚如何为我自己的数据集在 Keras 的 Conv2D 层中定义 input_shape

python - 如何构建具有多个输入的 Tensorflow 模型?

python - 类型错误 : unbound method setupUi() must be called with Ui_Form instance as first argument (got QDialog instance instead)

python - 如果其他列中的字符串包含列表中的内容,则更新一列中的值

python - 更改 logRecord 中的 levelname 格式

javascript - Evernote API NoteStore#updateNote 修改笔记更新时间,无论实际更改哪个字段