Tensorflow安装

来源:互联网 发布:聊城行知中学 编辑:程序博客网 时间:2024/06/03 21:39

下载python最新版本  https://www.python.org/downloads/windows/

安装pip  python-m pip install -U pip setuptools

库下载网站:https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy


安装库

pip install numpy

pip install mkl

pip install scipy

pip install scikit-learn

pip install matplotlib


测试

import numpy as npimport matplotlib.pyplot as pltplt.figure(1) # 创建图表1plt.figure(2) # 创建图表2ax1 = plt.subplot(211) # 在图表2中创建子图1ax2 = plt.subplot(212) # 在图表2中创建子图2x = np.linspace(0, 3, 100)for i in xrange(5):   plt.figure(1)  # 选择图表1   plt.plot(x, np.exp(i*x/3))    plt.sca(ax1)   # 选择图表2的子图1   plt.plot(x, np.sin(i*x))    plt.sca(ax2)  # 选择图表2的子图2   plt.plot(x, np.cos(i*x))plt.show()

第一步 下载拓展包 
下载网址:http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy 
查看python版本以及当前操作系统 
管理员身份进入控制台,如上图,可以查看python版本以及当前系统位数,图中python版本为3.5.2,系统64位,对应下载的拓展包如下:

  • numpy-1.12.0+mkl-cp35-cp35m-win_amd64.whl
  • scipy-0.18.1-cp35-cp35m-win_amd64.whl
  • matplotlib-2.0.0-cp35-cp35m-win_amd64.whl
  • scikit_learn-0.18.1-cp35-cp35m-win_amd64.whl

第二步安装 
管理员身份进入控制台,打开扩展包存储文件位置,安装命令行格式如下pip install packagename 
安装如下: 
这里写图片描述 
依次安装numpy+MKL→scipy→matplotlib→scikit-learn


pip install tensorflow