简单的安装tensorflow

引言: Tensorflow大名鼎鼎,这里不再赘述其为何物。这里讲描述在安装python包的时候碰到的“No matching distribution found for tensorflow”,其原因以及如何解决。

简单的安装tensorflow

这里安装的tensorflow的cpu版本,gpu版本可以自行搜索安装指南,或者参考如下指令:

pip3 install tensorflow #cpu

这里使用的python 3.6.3版本。

pip3 install tensorflow-gpu

这里是gpu的版本。

window的环境

window 7.

问题描述:

pip3 install tensorflow

如此简单的指令,应该不会出错吧,结果得到如下错误信息:

Collecting tensorflow 
Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow

为什么没有找到tensorflow呢?那我们自行找找看吧?

pip3 search tensorflow

具体的输出信息如下:

………………….. 
tensorbase (0.3) - Minimalistic TensorFlow 
Framework 
tensorbayes (0.3.0) - Deep Variational Inference in 
TensorFlow 
tensorflow-tensorboard (0.4.0rc3) - TensorBoard lets you watch 
Tensors Flow 
tensorboard_logger (0.0.4) - Log TensorBoard events without 
Tensorflow 
tensorboardX (0.8) - TensorBoardX lets you watch 
Tensors Flow without Tensorflow 
tensorbuilder (0.3.6) - A light wrapper over TensorFlow 
that enables you to easily 
create complex deep neural 
networks using the Builder 
Pattern through a functional 
fluent immutable API 
tensorflow-utils (0.1.0) - Classes and methods to make 
using TensorFlow easier 
tensorflow-transform (0.4.0) - A library for data 
preprocessing with TensorFlow 
tensorflow (1.5.0rc0) - TensorFlow helps the tensors 
flow 
tensorflow_forward_ad (0.3.3) - TensorFlow forward-mode 
automatic differentiation 
tensorflow_hmm (0.4.1) - Tensorflow and numpy 
implementations of the HMM 
viterbi and forward/backward 
algorithms 
tensorflow_nlp (0.0.1) - Deep Learning NLP Tasks 
implemented on Tensorflow 
tensorflowonspark (1.1.0) - Deep learning with TensorFlow 
on Apache Spark clusters 
tensorflowservingclient (0.5.1.post2) - Prebuilt tensorflow serving 
client 
tensorforce (0.3.4) - Reinforcement learning for 
TensorFlow 
tensorfunk (0.0.0) - tensorflow model converter to 
create tensorflow-independent 
prediction functions. 
tensorfuse (0.0.1) - Common interface for Theano, 
CGT, and TensorFlow 
tensorgraph (3.5.8) - A high level tensorflow library 
for building deep learning 
models 
tensorhive (0.1.1) - Lightweight computing resource 
management tool for executing 
distributed TensorFlow programs 
tensorlm (0.3) - TensorFlow wrapper for deep 
neural text generation on 
character or word level with 
RNNs / LSTMs 
TensorMol (0.1) - TensorFlow+Molecules = 
TensorMol 
tensorpack (0.8.0) - Neural Network Toolbox on 
TensorFlow 
tensorpy (1.1.0) - Easy Image Classification with 
TensorFlow! 
tensorrec (0.1) - A TensorFlow recommendation 
algorithm and framework in 
Python. 
tensorspark (1.0.6) - Tensorflow on Spark, a scalable 
system for high-performance 
machine learning 
tensorvision (0.1.dev1) - A library to build and train 
neural networks in with 
TensorFlow for Computer Vision 
TFANN (1.0.1) - A neural network module 
containing implementations of 
MLP, and CNN networks in 
TensorFlow. 
TFBOYS (0.0.1) - TensorFlow BOYS 
tfcf (0.0.0) - A tensorflow-based recommender 
system. 
tfcoreml (0.1.0) - Tensorflow to Core ML converter 
tfdebugger (0.1.1) - TensorFlow Debugger 
tfdeploy (0.4.2) - Deploy tensorflow graphs for 
fast evaluation and export to 
tensorflow-less environments 
running numpy. 
tfgraph (0.2) - Python’s Tensorflow Graph 
Library 
tfgraphviz (0.0.6) - A visualization tool to show a 
graph like TensorFlow and 
TensorBoard 
…………………………………………

悲伤的我如此难以自抑,明明可以找到的,怎么却无法安装嗯?我需要自行好好找找明明是谁? :-)

问题分析

二话不说,直接上官网上查查看,虽然官网离我朝远隔万里,需要跋山涉水之后方可达到。翻过拿到看不见的墙之后,重要可以看到官方信息了。 
官方路标如下: https://www.tensorflow.org/install/install_windows 
其中所提安装步骤非常简洁,如此简洁的步骤,怎么可能出错? 于是重新梳理了一下,难道是Python或者pip3本身的问题吗?

check pip3

pip –version

发现其为最新版本:

pip 9.0.1 from d:\program files (x86)\python\lib\site-packages (python 3.6)

那Python呢? 官方文档中提到如下:

If one of the following versions of Python is not installed on your machine, install it now: 
* Python 3.5.x 64-bit from python.org 
* Python 3.6.x 64-bit from python.org

难道我安装的python是假python不成? 估计有可能吧,难道是64bit的问题?

检查python的版本

python -v

得到了python的完整信息:

..........................................
> D:\Program Files (x86)\python\lib\__pycache__\sysconfig.cpython-36.pyc matches D:\Program Files (x86)\python\lib\sysconfig.py
>  code object from 'D:\\Program Files (x86)\\python\\lib\\__pycache__\\sysconfig.cpython-36.pyc'
import 'sysconfig' # <_frozen_importlib_external.SourceFileLoader object at 0x006A1230>
> D:\Program Files (x86)\python\lib\__pycache__\_bootlocale.cpython-36.pyc matches D:\Program Files (x86)\python\lib\_bootlocale.py
> code object from 'D:\\Program Files (x86)\\python\\lib\\__pycache__\\_bootlocale.cpython-36.pyc'
import '_locale' # 
import '_bootlocale' # <_frozen_importlib_external.SourceFileLoader object at 0x007911D0>
> D:\Program Files (x86)\python\lib\encodings\__pycache__\gbk.cpython-36.pyc matches D:\Program Files (x86)\python\lib\encodings\gbk.py
> code object from 'D:\\Program Files (x86)\\python\\lib\\encodings\\__pycache__\\gbk.cpython-36.pyc'
import '_codecs_cn' # 
import '_multibytecodec' # 
import 'encodings.gbk' # <_frozen_importlib_external.SourceFileLoader object at 0x00791490>
import 'site' # <_frozen_importlib_external.SourceFileLoader object at 0x004F73D0>
Python 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 17:26:49) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import 'atexit' # 

你可能感兴趣的:(简单的安装tensorflow)