在WIN10安装CPU版本的TensorFlow
安装环境:win10系统
Microsoft Windows [版本 10.0.16299.309]
(c) 2017 Microsoft Corporation。保留所有权利。
C:\Users\yxq>python
Python 2.7.14 |Anaconda custom (64-bit)| (default, Oct 15 2017, 03:34:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named tensorflow
>>> exit(0)
C:\Users\yxq>condacreate -n tensorflow python=3.5
'condacreate' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
C:\Users\yxq>conda create -n tensorflow python=3.5
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.4.7
latest version: 4.5.0
Please update conda by running
$ conda update -n base conda
## Package Plan ##
environment location: S:\Anaconda2\envs\tensorflow
added / updated specs:
- python=3.5
The following packages will be downloaded:
package | build
---------------------------|-----------------
setuptools-38.5.1 | py35_0 548 KB
wheel-0.30.0 | py35h38a90bc_1 85 KB
certifi-2018.1.18 | py35_0 144 KB
wincertstore-0.2 | py35hfebbdb8_0 13 KB
pip-9.0.1 | py35_5 2.6 MB
python-3.5.5 | h0c2934d_1 18.6 MB
------------------------------------------------------------
Total: 21.9 MB
The following NEW packages will be INSTALLED:
certifi: 2018.1.18-py35_0
pip: 9.0.1-py35_5
python: 3.5.5-h0c2934d_1
setuptools: 38.5.1-py35_0
vc: 14-h0510ff6_3
vs2015_runtime: 14.0.25123-3
wheel: 0.30.0-py35h38a90bc_1
wincertstore: 0.2-py35hfebbdb8_0
Proceed ([y]/n)? y
Downloading and Extracting Packages
setuptools 38.5.1: ############################################################################################ | 100%
wheel 0.30.0: ################################################################################################# | 100%
certifi 2018.1.18: ############################################################################################ | 100%
wincertstore 0.2: ############################################################################################# | 100%
pip 9.0.1: #################################################################################################### | 100%
python 3.5.5: ################################################################################################# | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use:
# > activate tensorflow
#
# To deactivate an active environment, use:
# > deactivate
#
# * for power-users using bash, you must source
#
C:\Users\yxq>activate tensorflow
(tensorflow) C:\Users\yxq>pip install --ignore -installed --upgrade tensorflow
Usage:
pip install [options] <requirement specifier> [package-index-options] ...
pip install [options] -r <requirements file> [package-index-options] ...
pip install [options] [-e] <vcs project url> ...
pip install [options] [-e] <local project path> ...
pip install [options] <archive url/path> ...
ambiguous option: --ignore (--ignore-installed, --ignore-requires-python?)
(tensorflow) C:\Users\yxq>import tensorflow as tf
'import' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
(tensorflow) C:\Users\yxq>python
Python 3.5.5 |Anaconda, Inc.| (default, Mar 12 2018, 17:44:09) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'tensorflow'
>>> exit(0)
(tensorflow) C:\Users\yxq>deactivate
C:\Users\yxq>conda --version
conda 4.4.7
C:\Users\yxq>conda update conda
Solving environment: \Exception in thread Thread-1:
Traceback (most recent call last):
File "S:\Anaconda2\lib\threading.py", line 801, in __bootstrap_inner
self.run()
File "S:\Anaconda2\lib\threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "S:\Anaconda2\lib\site-packages\conda\common\io.py", line 292, in _start_spinning
self.fh.write('\b' * self._indicator_length)
File "S:\Anaconda2\lib\site-packages\colorama\ansitowin32.py", line 34, in write
self.__convertor.write(text)
File "S:\Anaconda2\lib\site-packages\colorama\ansitowin32.py", line 115, in write
self.write_and_convert(text)
File "S:\Anaconda2\lib\site-packages\colorama\ansitowin32.py", line 142, in write_and_convert
self.write_plain_text(text, cursor, len(text))
File "S:\Anaconda2\lib\site-packages\colorama\ansitowin32.py", line 147, in write_plain_text
self.wrapped.write(text[start:end])
IOError: [Errno 0] Error
done
## Package Plan ##
environment location: S:\Anaconda2
added / updated specs:
- conda
The following packages will be downloaded:
package | build
---------------------------|-----------------
openssl-1.0.2n | hc64555f_0 4.6 MB
conda-4.5.0 | py27_0 1.0 MB
certifi-2018.1.18 | py27_0 144 KB
------------------------------------------------------------
Total: 5.8 MB
The following packages will be UPDATED:
certifi: 2017.7.27.1-py27hf761292_0 --> 2018.1.18-py27_0
conda: 4.4.7-py27_0 --> 4.5.0-py27_0
openssl: 1.0.2l-vc9h02d068b_2 --> 1.0.2n-hc64555f_0
Proceed ([y]/n)? ^Z
Downloading and Extracting Packages
CondaError: KeyboardInterrupt
终止批处理操作吗(Y/N)?
^C系统无法打开指定的设备或文件。
C:\Users\yxq>conda update conda
Solving environment: done
## Package Plan ##
environment location: S:\Anaconda2
added / updated specs:
- conda
The following packages will be downloaded:
package | build
---------------------------|-----------------
openssl-1.0.2n | hc64555f_0 4.6 MB
conda-4.5.0 | py27_0 1.0 MB
certifi-2018.1.18 | py27_0 144 KB
------------------------------------------------------------
Total: 5.8 MB
The following packages will be UPDATED:
certifi: 2017.7.27.1-py27hf761292_0 --> 2018.1.18-py27_0
conda: 4.4.7-py27_0 --> 4.5.0-py27_0
openssl: 1.0.2l-vc9h02d068b_2 --> 1.0.2n-hc64555f_0
Proceed ([y]/n)? y
Downloading and Extracting Packages
openssl 1.0.2n: ############################################################################################### | 100%
conda 4.5.0: ################################################################################################## | 100%
certifi 2018.1.18: ############################################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
C:\Users\yxq>ck should really be the equivalent of
'ck' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
C:\Users\yxq>conda info --envs
# conda environments:
#
base * S:\Anaconda2
S:\Anaconda2\Library\envs\gl-env
python36 S:\Anaconda2\envs\python36
tensorflow S:\Anaconda2\envs\tensorflow
C:\Users\yxq>activate tensorflow
(tensorflow) C:\Users\yxq>pip install tensorflow==1.1.0
Collecting tensorflow==1.1.0
Using cached tensorflow-1.1.0-cp35-cp35m-win_amd64.whl
Collecting numpy>=1.11.0 (from tensorflow==1.1.0)
Downloading numpy-1.14.2-cp35-none-win_amd64.whl (13.4MB)
100% |████████████████████████████████| 13.4MB 392kB/s
Collecting werkzeug>=0.11.10 (from tensorflow==1.1.0)
Using cached Werkzeug-0.14.1-py2.py3-none-any.whl
Collecting six>=1.10.0 (from tensorflow==1.1.0)
Using cached six-1.11.0-py2.py3-none-any.whl
Requirement already satisfied: wheel>=0.26 in s:\anaconda2\envs\tensorflow\lib\site-packages (from tensorflow==1.1.0)
Collecting protobuf>=3.2.0 (from tensorflow==1.1.0)
Downloading protobuf-3.5.2.post1-cp35-cp35m-win_amd64.whl (958kB)
100% |████████████████████████████████| 962kB 478kB/s
Requirement already satisfied: setuptools in s:\anaconda2\envs\tensorflow\lib\site-packages (from protobuf>=3.2.0->tensorflow==1.1.0)
Installing collected packages: numpy, werkzeug, six, protobuf, tensorflow
Successfully installed numpy-1.14.2 protobuf-3.5.2.post1 six-1.11.0 tensorflow-1.1.0 werkzeug-0.14.1
You are using pip version 9.0.1, however version 9.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
(tensorflow) C:\Users\yxq>python -m pip install --upgrade pip
Collecting pip
Downloading pip-9.0.3-py2.py3-none-any.whl (1.4MB)
100% |████████████████████████████████| 1.4MB 269kB/s
Installing collected packages: pip
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Successfully uninstalled pip-9.0.1
Successfully installed pip-9.0.3
(tensorflow) C:\Users\yxq>import tensorflow as tf
'import' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
(tensorflow) C:\Users\yxq>python
Python 3.5.5 |Anaconda, Inc.| (default, Mar 12 2018, 17:44:09) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> sess = tf.Session()
2018-03-23 14:20:15.479275: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations.
2018-03-23 14:20:15.506029: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE2 instructions, but these are available on your machine and could speed up CPU computations.
2018-03-23 14:20:15.511028: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
2018-03-23 14:20:15.515758: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2018-03-23 14:20:15.520857: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2018-03-23 14:20:15.526183: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2018-03-23 14:20:15.530135: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2018-03-23 14:20:15.533995: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
>>> a = tf.constant(10)
>>> a = tf.constant(22)
>>> print(sess.run(a+b))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'b' is not defined
>>> b = tf.constant(22)
>>> print(sess.run(a+b))
44
>>> a = tf.constant(2)
>>> print(sess.run(a+b))
24
>>> exit(0)
(tensorflow) C:\Users\yxq>pip install numpy --upgrade
Cache entry deserialization failed, entry ignored
Requirement already up-to-date: numpy in s:\anaconda2\envs\tensorflow\lib\site-packages
Cache entry deserialization failed, entry ignored
(tensorflow) C:\Users\yxq>pip install matplotlib --upgrade
Collecting matplotlib
Downloading matplotlib-2.2.2-cp35-cp35m-win_amd64.whl (8.7MB)
100% |████████████████████████████████| 8.7MB 80kB/s
Collecting pytz (from matplotlib)
Downloading pytz-2018.3-py2.py3-none-any.whl (509kB)
100% |████████████████████████████████| 512kB 245kB/s
Collecting python-dateutil>=2.1 (from matplotlib)
Downloading python_dateutil-2.7.0-py2.py3-none-any.whl (207kB)
100% |████████████████████████████████| 215kB 380kB/s
Collecting kiwisolver>=1.0.1 (from matplotlib)
Downloading kiwisolver-1.0.1-cp35-none-win_amd64.whl (57kB)
100% |████████████████████████████████| 61kB 331kB/s
Cache entry deserialization failed, entry ignored
Requirement already up-to-date: six>=1.10 in s:\anaconda2\envs\tensorflow\lib\site-packages (from matplotlib)
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib)
Using cached pyparsing-2.2.0-py2.py3-none-any.whl
Requirement already up-to-date: numpy>=1.7.1 in s:\anaconda2\envs\tensorflow\lib\site-packages (from matplotlib)
Collecting cycler>=0.10 (from matplotlib)
Using cached cycler-0.10.0-py2.py3-none-any.whl
Collecting setuptools (from kiwisolver>=1.0.1->matplotlib)
Downloading setuptools-39.0.1-py2.py3-none-any.whl (569kB)
100% |████████████████████████████████| 573kB 158kB/s
Installing collected packages: pytz, python-dateutil, setuptools, kiwisolver, pyparsing, cycler, matplotlib
Found existing installation: setuptools 38.5.1
Uninstalling setuptools-38.5.1:
Successfully uninstalled setuptools-38.5.1
Successfully installed cycler-0.10.0 kiwisolver-1.0.1 matplotlib-2.2.2 pyparsing-2.2.0 python-dateutil-2.7.0 pytz-2018.3 setuptools-39.0.1
(tensorflow) C:\Users\yxq>pip install jupyter --ipgrade
Usage:
pip install [options] <requirement specifier> [package-index-options] ...
pip install [options] -r <requirements file> [package-index-options] ...
pip install [options] [-e] <vcs project url> ...
pip install [options] [-e] <local project path> ...
pip install [options] <archive url/path> ...
no such option: --ipgrade
(tensorflow) C:\Users\yxq>pip install jupyter --upgrade
Collecting jupyter
Using cached jupyter-1.0.0-py2.py3-none-any.whl
Collecting nbconvert (from jupyter)
Using cached nbconvert-5.3.1-py2.py3-none-any.whl
Collecting ipykernel (from jupyter)
Downloading ipykernel-4.8.2-py3-none-any.whl (108kB)
100% |████████████████████████████████| 112kB 178kB/s
Collecting jupyter-console (from jupyter)
Using cached jupyter_console-5.2.0-py2.py3-none-any.whl
Collecting qtconsole (from jupyter)
Using cached qtconsole-4.3.1-py2.py3-none-any.whl
Collecting notebook (from jupyter)
Downloading notebook-5.4.1-py2.py3-none-any.whl (8.0MB)
100% |████████████████████████████████| 8.0MB 74kB/s
Collecting ipywidgets (from jupyter)
Downloading ipywidgets-7.1.2-py2.py3-none-any.whl (68kB)
100% |████████████████████████████████| 71kB 149kB/s
Collecting traitlets>=4.2 (from nbconvert->jupyter)
Using cached traitlets-4.3.2-py2.py3-none-any.whl
Collecting mistune>=0.7.4 (from nbconvert->jupyter)
Using cached mistune-0.8.3-py2.py3-none-any.whl
Collecting jinja2 (from nbconvert->jupyter)
Using cached Jinja2-2.10-py2.py3-none-any.whl
Collecting entrypoints>=0.2.2 (from nbconvert->jupyter)
Using cached entrypoints-0.2.3-py2.py3-none-any.whl
Collecting bleach (from nbconvert->jupyter)
Downloading bleach-2.1.3-py2.py3-none-any.whl
Collecting nbformat>=4.4 (from nbconvert->jupyter)
Using cached nbformat-4.4.0-py2.py3-none-any.whl
Collecting testpath (from nbconvert->jupyter)
Using cached testpath-0.3.1-py2.py3-none-any.whl
Collecting jupyter-core (from nbconvert->jupyter)
Using cached jupyter_core-4.4.0-py2.py3-none-any.whl
Collecting pygments (from nbconvert->jupyter)
Using cached Pygments-2.2.0-py2.py3-none-any.whl
Collecting pandocfilters>=1.4.1 (from nbconvert->jupyter)
Collecting ipython>=4.0.0 (from ipykernel->jupyter)
Using cached ipython-6.2.1-py3-none-any.whl
Collecting tornado>=4.0 (from ipykernel->jupyter)
Downloading tornado-5.0.1-cp35-cp35m-win_amd64.whl (438kB)
100% |████████████████████████████████| 440kB 174kB/s
Collecting jupyter-client (from ipykernel->jupyter)
Downloading jupyter_client-5.2.3-py2.py3-none-any.whl (89kB)
100% |████████████████████████████████| 92kB 225kB/s
Collecting prompt-toolkit<2.0.0,>=1.0.0 (from jupyter-console->jupyter)
Using cached prompt_toolkit-1.0.15-py3-none-any.whl
Collecting ipython-genutils (from qtconsole->jupyter)
Using cached ipython_genutils-0.2.0-py2.py3-none-any.whl
Collecting Send2Trash (from notebook->jupyter)
Downloading Send2Trash-1.5.0-py3-none-any.whl
Collecting terminado>=0.8.1 (from notebook->jupyter)
Downloading terminado-0.8.1-py2.py3-none-any.whl
Collecting widgetsnbextension~=3.1.0 (from ipywidgets->jupyter)
Downloading widgetsnbextension-3.1.4-py2.py3-none-any.whl (2.2MB)
100% |████████████████████████████████| 2.2MB 183kB/s
Requirement already up-to-date: six in s:\anaconda2\envs\tensorflow\lib\site-packages (from traitlets>=4.2->nbconvert->jupyter)
Collecting decorator (from traitlets>=4.2->nbconvert->jupyter)
Using cached decorator-4.2.1-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from jinja2->nbconvert->jupyter)
Collecting html5lib!=1.0b1,!=1.0b2,!=1.0b3,!=1.0b4,!=1.0b5,!=1.0b6,!=1.0b7,!=1.0b8,>=0.99999999pre (from bleach->nbconvert->jupyter)
Using cached html5lib-1.0.1-py2.py3-none-any.whl
Collecting jsonschema!=2.5.0,>=2.4 (from nbformat>=4.4->nbconvert->jupyter)
Using cached jsonschema-2.6.0-py2.py3-none-any.whl
Collecting colorama; sys_platform == "win32" (from ipython>=4.0.0->ipykernel->jupyter)
Using cached colorama-0.3.9-py2.py3-none-any.whl
Collecting jedi>=0.10 (from ipython>=4.0.0->ipykernel->jupyter)
Using cached jedi-0.11.1-py2.py3-none-any.whl
Collecting pickleshare (from ipython>=4.0.0->ipykernel->jupyter)
Using cached pickleshare-0.7.4-py2.py3-none-any.whl
Collecting win-unicode-console>=0.5; sys_platform == "win32" and python_version < "3.6" (from ipython>=4.0.0->ipykernel->jupyter)
Collecting simplegeneric>0.8 (from ipython>=4.0.0->ipykernel->jupyter)
Requirement already up-to-date: setuptools>=18.5 in s:\anaconda2\envs\tensorflow\lib\site-packages (from ipython>=4.0.0->ipykernel->jupyter)
Requirement already up-to-date: python-dateutil>=2.1 in s:\anaconda2\envs\tensorflow\lib\site-packages (from jupyter-client->ipykernel->jupyter)
Collecting pyzmq>=13 (from jupyter-client->ipykernel->jupyter)
Downloading pyzmq-17.0.0-cp35-cp35m-win_amd64.whl (942kB)
100% |████████████████████████████████| 942kB 247kB/s
Collecting wcwidth (from prompt-toolkit<2.0.0,>=1.0.0->jupyter-console->jupyter)
Using cached wcwidth-0.1.7-py2.py3-none-any.whl
Collecting pywinpty>=0.5; os_name == "nt" (from terminado>=0.8.1->notebook->jupyter)
Downloading pywinpty-0.5.1-cp35-cp35m-win_amd64.whl (176kB)
100% |████████████████████████████████| 184kB 409kB/s
Collecting webencodings (from html5lib!=1.0b1,!=1.0b2,!=1.0b3,!=1.0b4,!=1.0b5,!=1.0b6,!=1.0b7,!=1.0b8,>=0.99999999pre->bleach->nbconvert->jupyter)
Using cached webencodings-0.5.1-py2.py3-none-any.whl
Collecting parso==0.1.1 (from jedi>=0.10->ipython>=4.0.0->ipykernel->jupyter)
Using cached parso-0.1.1-py2.py3-none-any.whl
Installing collected packages: decorator, ipython-genutils, traitlets, mistune, MarkupSafe, jinja2, entrypoints, webencodings, html5lib, bleach, jupyter-core, jsonschema, nbformat, testpath, pygments, pandocfilters, nbconvert, wcwidth, prompt-toolkit, colorama, parso, jedi, pickleshare, win-unicode-console, simplegeneric, ipython, tornado, pyzmq, jupyter-client, ipykernel, jupyter-console, qtconsole, Send2Trash, pywinpty, terminado, notebook, widgetsnbextension, ipywidgets, jupyter
Successfully installed MarkupSafe-1.0 Send2Trash-1.5.0 bleach-2.1.3 colorama-0.3.9 decorator-4.2.1 entrypoints-0.2.3 html5lib-1.0.1 ipykernel-4.8.2 ipython-6.2.1 ipython-genutils-0.2.0 ipywidgets-7.1.2 jedi-0.11.1 jinja2-2.10 jsonschema-2.6.0 jupyter-1.0.0 jupyter-client-5.2.3 jupyter-console-5.2.0 jupyter-core-4.4.0 mistune-0.8.3 nbconvert-5.3.1 nbformat-4.4.0 notebook-5.4.1 pandocfilters-1.4.2 parso-0.1.1 pickleshare-0.7.4 prompt-toolkit-1.0.15 pygments-2.2.0 pywinpty-0.5.1 pyzmq-17.0.0 qtconsole-4.3.1 simplegeneric-0.8.1 terminado-0.8.1 testpath-0.3.1 tornado-5.0.1 traitlets-4.3.2 wcwidth-0.1.7 webencodings-0.5.1 widgetsnbextension-3.1.4 win-unicode-console-0.5
(tensorflow) C:\Users\yxq>
浙公网安备 33010602011771号