【问题标题】:Python 2, Python 3 and Anaconda on Windows 10. Now attempting to get Tensorflow to runWindows 10 上的 Python 2、Python 3 和 Anaconda。现在尝试让 Tensorflow 运行
【发布时间】:2017-06-11 16:44:57
【问题描述】:

我有带有 Python 2 的 Windows 10(64 位计算机)。这是cmd > 上的输出:

Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) 
[MSC v.1500 32 bit (Intel)] on win32

C:\Python27 中可见。

在同一文件夹中有 Python 3:C:\Python36-32

在我的路径中,我有 C:\ProgramData\Anaconda2\Scripts,它似乎默认为 Project Interpreter: 2.7.13 (C:\ProgramData\Anaconda2\python.exe)

因此,在 Python 3 中进行了大量的拉扯和改进代码之后(您可以查看我以前的帖子以获得一个想法),我启动并运行了 Python 2。

只有我最感兴趣的是 Google 选择用于 ML 的 Python - 特别是 Tensorflow。而且,唉,Tensorflow 在 Python 3 上运行!

没问题吧?毕竟我已经下载并安装在C:\...错了!

如果我在选择 Python3 后去 PyCharms 并尝试安装 Tensorflow,我会得到:

好的...所以我转到终端提示符,然后在那里尝试:

C:\Users\Toni>pip install tensorflow
Collecting tensorflow
  Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow

但这可能是因为我有 Python2?

所以我去谷歌,找到这个promising post,这让我觉得去cmd >并输入conda install python=3.5.0就可以了。

问题是,如果我运行这个程序,我会被要求卸载一堆我辛苦工作的东西,例如autograd 包...

我能否从 Dante 的 np.inferno 中获得有关如何运行 Tensorflow 的帮助?

【问题讨论】:

标签: python windows python-2.7 tensorflow anaconda


【解决方案1】:

这正是为了避免 conda 具有环境的冲突,您可以在其中安装新的单独的 conda 发行版。

在您的情况下,您可以通过调用专门为 tensorflow 创建一个环境(此处命名为 tensorflow,可以是其他任何名称)

conda create -n tensorflow python=3.5

然后把自己置身于环境中

activate tensorflow

然后从那里安装你提到的 tensorflow。

我必须说,这一切实际上在tensorflow's installation tutorial 中得到了很好的解释。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-12-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-31
    • 2020-10-29
    • 2019-07-24
    • 2014-07-22
    相关资源
    最近更新 更多