导入tensorflow时出错

时间:2015-12-06 06:03:39

标签: python ubuntu terminal tensorflow

我按照https://www.tensorflow.org/versions/master/get_started/os_setup.html#virtualenv_install Virtualenv中的说明操作,但是当我在Ubuntu终端import tensorflow as tf 中的python中输入此内容时,我收到此消息: File "<stdin>", line 1, in <module> ImportError: No module named tensorflow 我错了什么?

1 个答案:

答案 0 :(得分:0)

你是否在virtualenv中安装了tenserflow模块?

激活virtualenv后 尝试运行相关的pip命令来安装

# Ubuntu/Linux 64-bit, CPU only:
(tensorflow)$ pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled:
(tensorflow)$ pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl

# Mac OS X, CPU only:
(tensorflow)$ pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl