【问题标题】:Install tensorflow windows - python conflict安装tensorflow windows - python冲突
【发布时间】:2017-05-09 21:50:31
【问题描述】:

我正在尝试在运行 anaconda python 2.7.13 的 Windows 7 机器上安装 tensorflow。

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

我开始:

conda create -n tensorflow python=2.7

这提示我继续,我说是,它安装了几个包没有问题(似乎都指向 2.7 版本的 python)。

接下来我使用:

conda install -c conda-forge tensorflow

这给了我这个错误:

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.

有什么建议可以解决这个问题吗?

编辑:我也试过这个:

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

下一个:

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

并收到此错误消息:

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

【问题讨论】:

    标签: python windows tensorflow installation


    【解决方案1】:

    您是否有理由要使用 Python 2.7?如果你开始:

    $ conda create -n tensorflow python=3.6
    

    您应该能够按照您的尝试安装它,并运行最新版本来启动!否则你可以试试installing TensorFlow r0.12.1 with pip:

    $ 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
    

    如果您需要 GPU 支持,请将上面的 export 行替换为:

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

    我认为自从 TF 1.0.1 出来后,pip 是首选的安装方式。如果我不得不猜测,他们更改了通过conda-forge 提供的包,并且最新版本不适用于 Python 2.7(或者至少该版本在 conda-forge 上不可用)。我可能是错的,但这应该能让你到达那里。

    【讨论】:

    • 可能python=3.5 也可以。
    • 您使用的是 Linux / Unix 还是 Windows?
    • 应该在任何一个上都一样。如果您收到关于没有 pip 命令的错误消息,您可能需要添加一个指向 Anaconda 可执行文件的 PATH 环境变量。
    猜你喜欢
    • 2017-10-29
    • 1970-01-01
    • 2020-07-04
    • 2019-07-27
    • 2016-01-09
    • 2014-09-22
    • 1970-01-01
    • 1970-01-01
    • 2017-08-14
    相关资源
    最近更新 更多