简体   繁体   English

ModuleNotFoundError:在蟒蛇python 3.6.3中没有名为'tensorflow'的模块

[英]ModuleNotFoundError: No module named ‘tensorflow’ in anaconda python 3.6.3

i use Python 3.6.3 |Anaconda custom (64-bit) ubuntu 16.04 64 bits. 我使用Python 3.6.3 | Anaconda自定义(64位)ubuntu 16.04 64位。 I installed tensorflow. 我安装了tensorflow。 I did the following steps: 我做了以下步骤:

  1. conda create -n tensorflow pip python=3.6 康达创建-n tensorflow pip python = 3.6
  2. source activate tensorflow 源激活张量流
  3. pip install –ignore-installed –upgrade \\ https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.5.0-cp36-cp36m-linux_x86_64.whl pip install –ignore-installed –upgrade \\ https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.5.0-cp36-cp36m-linux_x86_64.whl

I have an import error of tensorflow: 我有张量流的导入错误:

ModuleNotFoundError Traceback (most recent call last) ModuleNotFoundError Traceback(最近一次调用)

in () —-> 1 import tensorflow as tf 在()---> 1 import tensorflow as tf

ModuleNotFoundError: No module named 'tensorflow' ModuleNotFoundError:没有名为“ tensorflow”的模块

How to solve it? 怎么解决呢? Thanks 谢谢

When you use anaconda, it's usually better to use the conda installer if possible. 使用anaconda时,如果可能的话,通常最好使用conda安装程序。

source activate tensorflow
conda install tensorflow

it will display something like: 它将显示如下内容:

Fetching package metadata .......
Solving package specifications: ..........

Package plan for installation in environment 
/usr/local/anaconda3/envs/tensorflow:

The following NEW packages will be INSTALLED:

backports:              1.0-py36_0          
backports.weakref:      1.0rc1-py36_0       
bleach:                 1.5.0-py36_0        
html5lib:               0.9999999-py36_0    
libprotobuf:            3.4.0-0             
markdown:               2.6.9-py36_0        
mkl:                    2017.0.3-0          
numpy:                  1.13.1-py36_0       
protobuf:               3.4.0-py36_0        
six:                    1.10.0-py36_0       
tensorflow:             1.3.0-0             
tensorflow-base:        1.3.0-py36h5293eaa_1
tensorflow-tensorboard: 0.1.5-py36_0        
werkzeug:               0.12.2-py36_0       

 Proceed ([y]/n)? y

Linking packages ...
[      COMPLETE      ]

then, you should be able to successfully import tensorflow 然后,您应该能够成功导入tensorflow

(tensorflow) user@ubuntu: $ python

Python 3.6.2 |Continuum Analytics, Inc.| (default, Jul 20 2017, 13:51:32) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ModuleNotFoundError:没有名为“tensorflow.python”的模块 Anaconda - ModuleNotFoundError: No module named 'tensorflow.python' Anaconda Anaconda:ModuleNotFoundError:没有名为“tensorflow”的模块 - Anaconda : ModuleNotFoundError: No module named 'tensorflow' ModuleNotFoundError:anaconda 中没有名为“tensorflow”的模块 - ModuleNotFoundError: No module named 'tensorflow' in anaconda Anaconda Python:ModuleNotFoundError:没有名为“matlab”的模块 - Anaconda Python: ModuleNotFoundError: No module named 'matlab' tensorflow 在 anaconda 控制台中工作,在笔记本中失败:.ModuleNotFoundError: No module named 'tensorflow' - tensorflow works in anaconda console, fails in notebook with:.ModuleNotFoundError: No module named 'tensorflow' ModuleNotFoundError:在 Windows 10 x64、Anaconda 和 spyder 4.0.1 和 python 37 上没有名为“tensorflow”的模块。 - ModuleNotFoundError : No module named 'tensorflow' on Windows 10 x64, Anaconda with spyder 4.0.1 and python 3.7 ModuleNotFoundError:为anaconda3安装Keras时,没有名为“ tensorflow”的模块 - ModuleNotFoundError: No module named 'tensorflow' while installing Keras for anaconda3 ModuleNotFoundError:没有名为“tensorflow.python.util”的模块 - ModuleNotFoundError: No module named 'tensorflow.python.util' ModuleNotFoundError:没有名为“tensorflow.python.trackable”的模块 - ModuleNotFoundError: No module named 'tensorflow.python.trackable' ModuleNotFoundError:没有名为“tensorflow.python.training”的模块 - ModuleNotFoundError: No module named 'tensorflow.python.training'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM