python3下安装tensorflow,感觉安装成功了可是总是有奇怪的东西跑出来?

已安装python3.6,现在安装tensorflow,下好安装包,放在python的scripts文件夹中。
在cmd中输入pip install tensorflow回车(尝试了好几次)。出现下面的数据:
Microsoft Windows 版本 10.0.17134.285 2018 Microsoft Corporation。保留所有权利。

C:\Users\lenovo>pip install tensorflow
Requirement already satisfied: tensorflow in c:\users\lenovo\appdata\local\programs\python\python36\lib\site-packages
Requirement already satisfied: numpy>=1.13.3 in c:\users\lenovo\appdata\local\programs\python\python36\lib\site-packages (from tensorflow)
Requirement already satisfied: tensorboard=1.11.0 in c:\users\lenovo\appdata\local\programs\python\python36\lib\site-packages (from tensorflow)
Requirement already satisfied: termcolor>=1.1.0 in c:\users\lenovo\appdata\local\programs\python\python36\lib\site-packages (from tensorflow)
Requirement already satisfied: six>=1.10.0 in c:\users\lenovo\appdata\local\programs\python\python36\lib\site-packages (from tensorflow)
Requirement already satisfied: astor>=0.6.0 in c:\users\lenovo\appdata\local\programs\python\python36\lib\site-packages (from tensorflow)
Requirement already satisfied: grpcio>=1.8.6 in c:\users\lenovo\appdata\local\programs\python\python36\lib\site-packages (from tensorflow)
Requirement already satisfied: protobuf>=3.6.0 in c:\users\lenovo\appdata\local\programs\python\python36\lib\site-packages (from tensorflow)
Requirement already satisfied: setuptools<=39.1.0 in c:\users\lenovo\appdata\local\programs\python\python36\lib\site-packages (from tensorflow)
Requirement already satisfied: wheel>=0.26 in c:\users\lenovo\appdata\local\programs\python\python36\lib\site-packages (from tensorflow)
Requirement already satisfied: absl-py>=0.1.6 in c:\users\lenovo\appdata\local\programs\python\python36\lib\site-packages (from tensorflow)
Requirement already satisfied: keras-preprocessing>=1.0.3 in c:\users\lenovo\appdata\local\programs\python\python36\lib\site-packages (from tensorflow)
Requirement already satisfied: keras-applications>=1.0.5 in c:\users\lenovo\appdata\local\programs\python\python36\lib\site-packages (from tensorflow)
Requirement already satisfied: gast>=0.2.0 in c:\users\lenovo\appdata\local\programs\python\python36\lib\site-packages (from tensorflow)
Requirement already satisfied: markdown>=2.6.8 in c:\users\lenovo\appdata\local\programs\python\python36\lib\site-packages (from tensorboard=1.11.0->tensorflow)
Requirement already satisfied: werkzeug>=0.11.10 in c:\users\lenovo\appdata\local\programs\python\python36\lib\site-packages (from tensorboard=1.11.0->tensorflow)
Requirement already satisfied: h5py in c:\users\lenovo\appdata\local\programs\python\python36\lib\site-packages (from keras-applications>=1.0.5->tensorflow)
You are using pip version 9.0.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

C:\Users\lenovo>

我看出现Requirement already satisfied: tensorflow in c:\users\lenovo\appdata\local\programs\python\python36\lib\site-packages
不是就是安装成功了吗?

可是我在调用的时候又出现了这个:
=================== RESTART: D:\python-files\keras\num.py ===================
Using TensorFlow backend.
Traceback (most recent call last):
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\lenovo\AppData\Local\Programs\Python\Python36\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: 动态链接库(DLL)初始化例程失败。

反正就是又失败了。

所以我这个tensorflow是安装成功了还是失败了?为什么会这样嘞?

3个回答

用pip安装低版本的tensorflow 例如 pip install tensorflow==1.150

可以试一下python3.5,windows 下python3.6安装tensorflow可能会有问题。此外也可以安装anaconda3.5再安装tensorflow。

我也有这种情况,在Ubuntu16.04中,用pip3安装tensorflow-GPU似乎是安装成功了,因为在Python中import tensorflow as tf之后,查询tensorflow版本是1.6.0是对的。
但是,当我运行程序时,却显示ImportError: No module named 'tensorflow'。
又尝试pip安装,就显示的和博主一样了,各种Requirement already satisfied。
没办法我只能用anaconda安装,tensorflow是可以用了。但是还是想搞明白为啥之前用pip安装,Python中显示已经安装了tensorflow,但是却不能使用的原因,如何解决这个问题。

neu_ZZM
neu_ZZM 安装了却无法使用可能安装路径不对,python只认自己版本文件夹下的包,可以在环境变量里加上python件夹下的Sctipt文件夹试一下,然后把下的tensorflow文件下移动到python文件夹下的Lib\site-packages里
大约一年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问