Tensorflow安装问题: Could not find a version that satisfies the requirement tensorflow
引言:Tensorflow大名鼎鼎,这里不再赘述其为何物。这里讲描述在安装python包的时候碰到的“Nomatchingdistributionfoundfortensorflow”,其原因以及如何解决。
简单的安装tensorflow
这里安装的tensorflow的cpu版本,gpu版本可以自行搜索安装指南,或者参考如下指令:
pip3installtensorflow#cpu
这里使用的python3.6.3版本。
pip3installtensorflow-gpu
这里是gpu的版本。
window的环境
window7.
问题描述:
pip3installtensorflow
如此简单的指令,应该不会出错吧,结果得到如下错误信息:
Collectingtensorflow
Couldnotfindaversionthatsatisfiestherequirementtensorflow(fromversions:)Nomatchingdistributionfoundfortensorflow
为什么没有找到tensorflow呢?那我们自行找找看吧?
pip3searchtensorflow
具体的输出信息如下:
…………………..
tensorbase(0.3)-MinimalisticTensorFlow
Framework
tensorbayes(0.3.0)-DeepVariationalInferencein
TensorFlow
tensorflow-tensorboard(0.4.0rc3)-TensorBoardletsyouwatch
TensorsFlow
tensorboard_logger(0.0.4)-LogTensorBoardeventswithout
Tensorflow
tensorboardX(0.8)-TensorBoardXletsyouwatch
TensorsFlowwithoutTensorflow
tensorbuilder(0.3.6)-AlightwrapperoverTensorFlow
thatenablesyoutoeasily
createcomplexdeepneural
networksusingtheBuilder
Patternthroughafunctional
fluentimmutableAPI
tensorflow-utils(0.1.0)-Classesandmethodstomake
usingTensorFloweasier
tensorflow-transform(0.4.0)-Alibraryfordata
preprocessingwithTensorFlow
tensorflow(1.5.0rc0)-TensorFlowhelpsthetensors
flow
tensorflow_forward_ad(0.3.3)-TensorFlowforward-mode
automaticdifferentiation
tensorflow_hmm(0.4.1)-Tensorflowandnumpy
implementationsoftheHMM
viterbiandforward/backward
algorithms
tensorflow_nlp(0.0.1)-DeepLearningNLPTasks
implementedonTensorflow
tensorflowonspark(1.1.0)-DeeplearningwithTensorFlow
onApacheSparkclusters
tensorflowservingclient(0.5.1.post2)-Prebuilttensorflowserving
client
tensorforce(0.3.4)-Reinforcementlearningfor
TensorFlow
tensorfunk(0.0.0)-tensorflowmodelconverterto
createtensorflow-independent
predictionfunctions.
tensorfuse(0.0.1)-CommoninterfaceforTheano,
CGT,andTensorFlow
tensorgraph(3.5.8)-Ahighleveltensorflowlibrary
forbuildingdeeplearning
models
tensorhive(0.1.1)-Lightweightcomputingresource
managementtoolforexecuting
distributedTensorFlowprograms
tensorlm(0.3)-TensorFlowwrapperfordeep
neuraltextgenerationon
characterorwordlevelwith
RNNs/LSTMs
TensorMol(0.1)-TensorFlow+Molecules=
TensorMol
tensorpack(0.8.0)-NeuralNetworkToolboxon
TensorFlow
tensorpy(1.1.0)-EasyImageClassificationwith
TensorFlow!
tensorrec(0.1)-ATensorFlowrecommendation
algorithmandframeworkin
Python.
tensorspark(1.0.6)-TensorflowonSpark,ascalable
systemforhigh-performance
machinelearning
tensorvision(0.1.dev1)-Alibrarytobuildandtrain
neuralnetworksinwith
TensorFlowforComputerVision
TFANN(1.0.1)-Aneuralnetworkmodule
containingimplementationsof
MLP,andCNNnetworksin
TensorFlow.
TFBOYS(0.0.1)-TensorFlowBOYS
tfcf(0.0.0)-Atensorflow-basedrecommender
system.
tfcoreml(0.1.0)-TensorflowtoCoreMLconverter
tfdebugger(0.1.1)-TensorFlowDebugger
tfdeploy(0.4.2)-Deploytensorflowgraphsfor
fastevaluationandexportto
tensorflow-lessenvironments
runningnumpy.
tfgraph(0.2)-Python'sTensorflowGraph
Library
tfgraphviz(0.0.6)-Avisualizationtooltoshowa
graphlikeTensorFlowand
TensorBoard
…………………………………………
悲伤的我如此难以自抑,明明可以找到的,怎么却无法安装嗯?我需要自行好好找找明明是谁?:-)
问题分析
二话不说,直接上官网上查查看,虽然官网离我朝远隔万里,需要跋山涉水之后方可达到。翻过拿到看不见的墙之后,重要可以看到官方信息了。
官方路标如下:https://www.tensorflow.org/install/install_windows
其中所提安装步骤非常简洁,如此简洁的步骤,怎么可能出错?于是重新梳理了一下,难道是Python或者pip3本身的问题吗?
checkpip3
pip–version
发现其为最新版本:
pip9.0.1fromd:\programfiles(x86)\python\lib\site-packages(python3.6)
那Python呢?官方文档中提到如下:
IfoneofthefollowingversionsofPythonisnotinstalledonyourmachine,installitnow:
*Python3.5.x64-bitfrompython.org
*Python3.6.x64-bitfrompython.org
难道我安装的python是假python不成?估计有可能吧,难道是64bit的问题?
检查python的版本
python-v
得到了python的完整信息:
..........................................
>D:\ProgramFiles(x86)\python\lib\__pycache__\sysconfig.cpython-36.pycmatchesD:\ProgramFiles(x86)\python\lib\sysconfig.py
> codeobjectfrom'D:\\ProgramFiles(x86)\\python\\lib\\__pycache__\\sysconfig.cpython-36.pyc'
import'sysconfig'#<_frozen_importlib_external.SourceFileLoaderobjectat0x006A1230>
>D:\ProgramFiles(x86)\python\lib\__pycache__\_bootlocale.cpython-36.pycmatchesD:\ProgramFiles(x86)\python\lib\_bootlocale.py
>codeobjectfrom'D:\\ProgramFiles(x86)\\python\\lib\\__pycache__\\_bootlocale.cpython-36.pyc'
import'_locale'#
import'_bootlocale'#<_frozen_importlib_external.SourceFileLoaderobjectat0x007911D0>
>D:\ProgramFiles(x86)\python\lib\encodings\__pycache__\gbk.cpython-36.pycmatchesD:\ProgramFiles(x86)\python\lib\encodings\gbk.py
>codeobjectfrom'D:\\ProgramFiles(x86)\\python\\lib\\encodings\\__pycache__\\gbk.cpython-36.pyc'
import'_codecs_cn'#
import'_multibytecodec'#
import'encodings.gbk'#<_frozen_importlib_external.SourceFileLoaderobjectat0x00791490>
import'site'#<_frozen_importlib_external.SourceFileLoaderobjectat0x004F73D0>
Python3.6.3(v3.6.3:2c5fed8,Oct 32017,17:26:49)[MSCv.190032bit(Intel)]onwin32
Type"help","copyright","credits"or"license"formoreinformation.
import'atexit'#
其中关于python的关键信息:
Python3.6.3(v3.6.3:2c5fed8,Oct32017,17:26:49)[MSCv.190032bit(Intel)]onwin32
“32bit”!!!一口老血喷出,众里寻他千百度,蓦然回首bug正在这灯火阑珊处。原来是python版本的问题导致的。
修复问题
重新下载一个64bit的python版本,之后重新操作就可以了。
python-v
查看其中的关键信息:
Python3.6.4(v3.6.4:d48eceb,Dec192017,06:54:40)[MSCv.190064bit(AMD64)]onwin32
确认是64位,没有问题。
然后直接安装tensorflow:
pip3installtensorflow
安装过程如下:
C:\windows\system32>pip3installtensorflow
Collectingtensorflow
Downloadingtensorflow-1.4.0-cp36-cp36m-win_amd64.whl(28.3MB)
100%|████████████████████████████████|28.3MB39kB/s
Collectingenum34>=1.1.6(fromtensorflow)
Downloadingenum34-1.1.6-py3-none-any.whl
Requirementalreadysatisfied:wheel>=0.26ind:\programfiles(x86)\python\lib\site-packages(fromtensorflow)
Collectingprotobuf>=3.3.0(fromtensorflow)
Downloadingprotobuf-3.5.1-py2.py3-none-any.whl(388kB)
100%|████████████████████████████████|389kB593kB/s
Collectingtensorflow-tensorboard<0.5.0,>=0.4.0rc1(fromtensorflow)
Downloadingtensorflow_tensorboard-0.4.0rc3-py3-none-any.whl(1.7MB)
100%|████████████████████████████████|1.7MB182kB/s
Requirementalreadysatisfied:six>=1.10.0ind:\programfiles(x86)\python\lib\site-packages(fromtensorflow)
Collectingnumpy>=1.12.1(fromtensorflow)
Downloadingnumpy-1.13.3-cp36-none-win_amd64.whl(13.1MB)
100%|████████████████████████████████|13.1MB81kB/s
Requirementalreadysatisfied:setuptoolsind:\programfiles(x86)\python\lib\site-packages(fromprotobuf>=3.3.0->tensorflow)
Collectinghtml5lib==0.9999999(fromtensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow)
Downloadinghtml5lib-0.9999999.tar.gz(889kB)
100%|████████████████████████████████|890kB504kB/s
Collectingbleach==1.5.0(fromtensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow)
Downloadingbleach-1.5.0-py2.py3-none-any.whl
Requirementalreadysatisfied:werkzeug>=0.11.10ind:\programfiles(x86)\python\lib\site-packages(fromtensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow)
Collectingmarkdown>=2.6.8(fromtensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow)
DownloadingMarkdown-2.6.11-py2.py3-none-any.whl(78kB)
100%|████████████████████████████████|81kB583kB/s
Buildingwheelsforcollectedpackages:html5lib
Runningsetup.pybdist_wheelforhtml5lib...done
Storedindirectory:C:\Users\chenjunfeng1\AppData\Local\pip\Cache\wheels\6f\85\6c\56b8e1292c6214c4eb73b9dda50f53e8e977bf65989373c962
Successfullybuilthtml5lib
Installingcollectedpackages:enum34,protobuf,html5lib,numpy,bleach,markdown,tensorflow-tensorboard,tensorflow
Successfullyinstalledbleach-1.5.0enum34-1.1.6html5lib-0.9999999markdown-2.6.11numpy-1.13.3protobuf-3.5.1tensorflow-1.4.0tensorflow-tensorboard-0.4.0rc3
然后大家就可以愉快地写代码了.
总结
问题总在认为不可能的地方发生。如果存在问题,则一定会有原因存在。见或者不见,它都在那里。
到此这篇关于Tensorflow安装问题:Couldnotfindaversionthatsatisfiestherequirementtensorflow的文章就介绍到这了,更多相关Tensorflow安装问题内容请搜索毛票票以前的文章或继续浏览下面的相关文章希望大家以后多多支持毛票票!