简体   繁体   English

安装Tensorflow Windows-Python冲突

[英]Install tensorflow windows - python conflict

I'm trying to install tensorflow on a windows 7 machine running anaconda python 2.7.13. 我正在尝试在运行anaconda python 2.7.13的Windows 7计算机上安装tensorflow。

C:\>python -V
Python 2.7.13 :: Anaconda 4.3.1 (64-bit)

I start by : 我开始于:

conda create -n tensorflow python=2.7

This prompts me to proceed, I say yes and it installs several packages without issue (all seem to point to a 2.7 version of python). 这提示我继续,我说是,它安装了几个没有问题的软件包(所有软件包似乎都指向2.7版本的python)。

Next I use : 接下来我用:

conda install -c conda-forge tensorflow

Which gives me this error: 这给了我这个错误:

UnsatisfiableError: The following specifications were found to be in conflict:
  - python 2.7*
  - tensorflow -> python 3.5*
Use "conda info <package>" to see the dependencies for each package.

Any suggestions how to fix this? 任何建议如何解决此问题?

EDIT: I also tried this: 编辑:我也尝试过此:

C:\>pip3 install --upgrade tensorflow
'pip3' is not recognized as an internal or external command,
operable program or batch file.

Next: 下一个:

pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.1.0-cp35-cp35m-win_amd64.whl

and got this error message: 并得到以下错误信息:

tensorflow-1.1.0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platf
orm.

Is there a reason you want to use Python 2.7? 您是否有理由要使用Python 2.7? If you start with: 如果您从以下内容开始:

$ conda create -n tensorflow python=3.6

you should be able to install it how you are trying to, and run the latest release to boot! 您应该能够按照自己的意愿安装它,并运行最新版本进行引导! Otherwise, you might try installing TensorFlow r0.12.1 with pip : 否则,您可以尝试使用pip安装TensorFlow r0.12.1

$ source activate tensorflow
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.1-cp27-none-linux_x86_64.whl
$ pip install --ignore-installed --upgrade $TF_BINARY_URL

If you need GPU support, replace the export line in the above with: 如果需要GPU支持,则将上面的export行替换为:

$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-0.12.1-cp27-none-linux_x86_64.whl

I think since TF 1.0.1 came out, pip is the preferred installation method. 我认为自TF 1.0.1发布以来, pip是首选的安装方法。 If I had to guess, they changed the packages available through conda-forge and the newest version does not work with Python 2.7 (or at least that version is not available on conda-forge). 如果我不得不猜测,他们更改了可通过conda-forge获得的软件包,并且最新版本不适用于Python 2.7(或者至少该版本在conda-forge上不可用)。 I could be wrong, but this should get you there either way. 我可能是错的,但这应该可以使您到达那里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM