简体   繁体   English

如何在Windows 10和Anaconda上安装Tensorflow?

[英]How to install Tensorflow on Windows 10 with anaconda?

I know that there exists a link for installing Tensorflow for python 3.5 on 我知道有一个链接用于在python 3.5上安装Tensorflow
Windows Installation link . Windows安装链接 There also a similar question on StackOverflow link also, but it case when I use this command: StackOverflow链接上也有类似的问题,但是当我使用此命令时会出现这种情况:

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

But it said Wheel package needs to be updated. 但是它说Wheel包需要更新。 So I updated it using pip and ran the application once again. 因此,我使用pip更新了它并再次运行了该应用程序。 The output was 输出是

tensorflow-1.0.0-cp35-cp35m-win_x86_64.whl is not a supported wheel on this platform.

So how do I solve this problem ? 那么我该如何解决这个问题呢? Please help. 请帮忙。 I've tried to install the cpu version of TensorFlow. 我尝试安装TensorFlow的cpu版本。

conda upgrade conda
conda upgrade --all
conda create -n tensorflow python=3.5.
activate tensorflow
conda install -c conda-forge tensorflow

This will create an "environment" that will contain all of your packages you need (the example above is just tensorflow) and you will be able to import that library while you are in that environment anaconda is really just used to manage packages and segregate projects that require different packages 这将创建一个“环境”,其中将包含您需要的所有软件包(上面的示例仅为tensorflow),并且您将能够在该环境中导入该库, anaconda实际上仅用于管理软件包和隔离项目需要不同的包装

When your finished with your environment, to close out use: 完成环境的使用后,请封闭使用:

deactivate

these commands are slightly different on OSX/Linux so be sure to look them up if you are on a different operating system 这些命令在OSX / Linux上略有不同,因此如果您使用的是其他操作系统,请务必查找它们

If you are using TF for some machine learning then you will probably want these packages in your environment as well: 如果您正在使用TF进行某些机器学习,那么您可能也希望在您的环境中使用这些软件包:

conda install pandas matplotlib jupyter notebook scipy scikit-learn

Place that line between (activate tensorflow) and (conda install) 将该行放在(激活tensorflow)和(conda安装)之间

The executable, Anaconda for python 3.5 is not available on the official website. 官方网站上没有提供用于Python 3.5的Anaconda可执行文件。 An alternative to downloading that version is to download the latest version of Anaconda(3.6 as of 9 May, 2017), open your cmd shell in windows and execute the following commands. 下载该版本的另一种方法是下载最新版本的Anaconda(截至2017年5月9日为3.6),在Windows中打开cmd shell并执行以下命令。 Note that the activate command is not fully supported in Windows Powershell. 请注意,Windows Powershell不完全支持activate命令。 Click here to see why. 单击此处查看原因。

conda create --name tensorflow python=3.5
activate tensorflow
conda install -c conda-forge tensorflow=1.0.0

The answer has been borrowed from Anaconda Public Google Group. 答案是从Anaconda Public Google Group借来的。

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

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