有人可以向我解释一下如何逐步安装Tensorflow for Python 3.7.0! (我正在使用ipython)!我的系统是windows 10 64位系统。即使我到目前为止找到的所有解释,我也不明白该怎么做。那么有人能指出我必须点击安装张量流的确切链接吗? TNX
ImportError Traceback (most recent call last)
~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>()
57
---> 58 from tensorflow.python.pywrap_tensorflow_internal import *
59 from tensorflow.python.pywrap_tensorflow_internal import __version__
~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in <module>()
27 return _mod
---> 28 _pywrap_tensorflow_internal = swig_import_helper()
29 del swig_import_helper
~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in swig_import_helper()
23 try:
---> 24 _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
25 finally:
~\Anaconda3\lib\imp.py in load_module(name, file, filename, details)
242 else:
--> 243 return load_dynamic(name, filename, file)
244 elif type_ == PKG_DIRECTORY:
~\Anaconda3\lib\imp.py in load_dynamic(name, path, file)
342 name=name, loader=loader, origin=path)
--> 343 return _load(spec)
344
ImportError: DLL load failed: Een initialisatieroutine van de dynamic link library (DLL-bestand) is mislukt.
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
<ipython-input-2-fae406f752e9> in <module>()
6 from PIL import Image
7 from scipy import ndimage
----> 8 import tensorflow as tf
9 from tensorflow.python.framework import ops
10 from cnn_utils import *
~\Anaconda3\lib\site-packages\tensorflow\__init__.py in <module>()
20
21 # pylint: disable=g-bad-import-order
---> 22 from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
23
24 try:
~\Anaconda3\lib\site-packages\tensorflow\python\__init__.py in <module>()
47 import numpy as np
48
---> 49 from tensorflow.python import pywrap_tensorflow
50
51 # Protocol buffers
~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>()
72 for some common reasons and solutions. Include the entire stack trace
73 above this error message when asking for help.""" % traceback.format_exc()
---> 74 raise ImportError(msg)
75
76 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long
ImportError: Traceback (most recent call last):
File "C:\Users\gstevens\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\gstevens\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\gstevens\Anaconda3\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\gstevens\Anaconda3\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\gstevens\Anaconda3\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: Een initialisatieroutine van de dynamic link library (DLL-bestand) is mislukt.
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_problems
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
总结official tensorflow installation guide的安装步骤,专门针对您的情况。
既然你已经在你的机器上安装了Python 3.6和Conda(这很好!)我们可以继续确认其他的东西。
安装Microsoft Visual C ++ 2015 Redistributable Update 3.它随Visual Studio 2015一起提供,但可以单独安装:
打开命令提示符。由于您已经使用名称tensorflow
创建了环境,因此您只需:
conda create -n venv pip python=3.6
。将venv
替换为您选择的环境名称。source activate tensorflow
。此行中的tensorflow
是您运行conda create -n tensorflow python=3.6
时命名的Conda环境的名称。除非您已按照步骤1并创建了新环境,否则请将tensorflow
替换为您在步骤1中使用的名称。pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.11.0-cp36-cp36m-win_amd64.whl
如果您将来再次安装此URL,请根据URL列表更新上述命令中的URL。上面的命令最终会过时。
重新启动命令提示符,然后再次激活conda环境,然后运行python -c "import tensorflow as tf; print(tf.__version__)"
,它应该打印已安装的Tensorflow版本,在本例中为1.11.0。如果是,那么您已在Conda虚拟环境中成功安装了Tensorflow。恭喜!
如果它不起作用,请在此处评论,以便我可以修改我的答案以进一步帮助您。
Tensorflow还不支持Python 3.7(https://github.com/tensorflow/tensorflow/issues/17022)。
使用Python 3.6。