Tensorflow安裝問題: Could not find a version that satisfies the requirement tensorflow pip命令

引言: Tensorflow大名鼎鼎,這裏再也不贅述其爲什麼物。這裏講描述在安裝python包的時候碰到的「No matching distribution found for tensorflow」,其緣由以及如何解決。html

簡單的安裝tensorflow
這裏安裝的tensorflow的cpu版本,gpu版本能夠自行搜索安裝指南,或者參考以下指令:html5

pip3 install tensorflow #cpupython

這裏使用的python 3.6.3版本。windows

pip3 install tensorflow-gpumarkdown

這裏是gpu的版本。app

window的環境
window 7.less

問題描述:
pip3 install tensorflowpost

如此簡單的指令,應該不會出錯吧,結果獲得以下錯誤信息:ui

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

爲何沒有找到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' # <class '_frozen_importlib.BuiltinImporter'>
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' # <class '_frozen_importlib.BuiltinImporter'>
import '_multibytecodec' # <class '_frozen_importlib.BuiltinImporter'>
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' # <class '_frozen_importlib.BuiltinImporter'>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
其中關於python的關鍵信息:

Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 17:26:49) [MSC v.1900 32 bit (Intel)] on win32

「32bit」 !!! 一口老血噴出,衆裏尋他千百度,驀然回首bug正在這燈火闌珊處。原來是python版本的問題致使的。

修復問題
從新下載一個64bit的python版本,以後從新操做就能夠了。

python -v

查看其中的關鍵信息:

Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32

確認是64位,沒有問題。

而後直接安裝tensorflow:

pip3 install tensorflow

安裝過程以下:

C:\windows\system32>pip3 install tensorflowCollecting tensorflow Downloading tensorflow-1.4.0-cp36-cp36m-win_amd64.whl (28.3MB) 100% |████████████████████████████████| 28.3MB 39kB/sCollecting enum34>=1.1.6 (from tensorflow) Downloading enum34-1.1.6-py3-none-any.whlRequirement already satisfied: wheel>=0.26 in d:\program files (x86)\python\lib\site-packages (from tensorflow)Collecting protobuf>=3.3.0 (from tensorflow) Downloading protobuf-3.5.1-py2.py3-none-any.whl (388kB) 100% |████████████████████████████████| 389kB 593kB/sCollecting tensorflow-tensorboard<0.5.0,>=0.4.0rc1 (from tensorflow) Downloading tensorflow_tensorboard-0.4.0rc3-py3-none-any.whl (1.7MB) 100% |████████████████████████████████| 1.7MB 182kB/sRequirement already satisfied: six>=1.10.0 in d:\program files (x86)\python\lib\site-packages (from tensorflow)Collecting numpy>=1.12.1 (from tensorflow) Downloading numpy-1.13.3-cp36-none-win_amd64.whl (13.1MB) 100% |████████████████████████████████| 13.1MB 81kB/sRequirement already satisfied: setuptools in d:\program files (x86)\python\lib\site-packages (from protobuf>=3.3.0->tensorflow)Collecting html5lib==0.9999999 (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow) Downloading html5lib-0.9999999.tar.gz (889kB) 100% |████████████████████████████████| 890kB 504kB/sCollecting bleach==1.5.0 (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow) Downloading bleach-1.5.0-py2.py3-none-any.whlRequirement already satisfied: werkzeug>=0.11.10 in d:\program files (x86)\python\lib\site-packages (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow)Collecting markdown>=2.6.8 (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow) Downloading Markdown-2.6.11-py2.py3-none-any.whl (78kB) 100% |████████████████████████████████| 81kB 583kB/sBuilding wheels for collected packages: html5lib Running setup.py bdist_wheel for html5lib ... done Stored in directory: C:\Users\chenjunfeng1\AppData\Local\pip\Cache\wheels\6f\85\6c\56b8e1292c6214c4eb73b9dda50f53e8e977bf65989373c962Successfully built html5libInstalling collected packages: enum34, protobuf, html5lib, numpy, bleach, markdown, tensorflow-tensorboard, tensorflowSuccessfully installed bleach-1.5.0 enum34-1.1.6 html5lib-0.9999999 markdown-2.6.11 numpy-1.13.3 protobuf-3.5.1 tensorflow-1.4.0 tensorflow-tensorboard-0.4.0rc3123456789101112131415161718192021222324252627282930313233而後你們就能夠愉快地寫代碼了.

相關文章
相關標籤/搜索