查看“Centos7 安装Python3、安装TensorFlow以及卸载”的源代码
←
Centos7 安装Python3、安装TensorFlow以及卸载
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{4}} 1.下载Python3 https://www.python.org/getit/ 两个包都可以使用,不过最好不要下载XZ格式的!!!会出现一些麻烦!!! Version Operating System Description MD5 Sum File Size Gzipped source tarball Source release 2d0fc9f3a5940707590e07f03ecb08b9 22540566 XZ compressed source tarball Source release 692b4fc3a2ba0d54d1495d4ead5b0b5c 16872064 下载示例: (1)linux中可以直接下载 wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz (2)可以下载到本地然后传到linux上。看个人喜好。 2.创建一个文件夹:mkdir /usr/local/python3 解压文件 tar -xf Python-3.6.5.tgz -C /usr/local/python3 3.解压之后有一个目录/usr/local/python3目录下有,Python 3.6.5,进入目录 cd Python-3.6.5 4.开始安装,使用编译的方法进行安装 确保已经安装以下依赖 yum install gcc-c++ yum install pcre pcre-devel yum install zlib zlib-devel yum install openssl openssl--devel 然后执行 ./configure prefix=/usr/local/python3 make && make install 创建软链接 ln -s /usr/local/Python3/bin/python3 /usr/bin/python3 ln -s /usr/local/Python3/bin/pip3 /usr/bin/pip3 5.完成后再控制台输入python3,测试一下python3 安装是否成功。 6.安装TensorFlow pip3 install tensorflow 指定版本的安装 pip install tensorflow==1.6.0 7.验证安装 $ python3 Python 3.5.3 (default, Jan 19 2017, 14:11:04) [GCC 6.3.0 20170118] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import tensorflow as tf >>> hello = tf.constant('Hello, TensorFlow!') >>> sess = tf.Session() 2017-08-28 13:02:47.410873: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. 2017-08-28 13:02:47.410971: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. 2017-08-28 13:02:47.410990: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. >>> print(sess.run(hello)) b'Hello, TensorFlow!' >>> a = tf.constant(10) >>> b = tf.constant(32) >>> print(sess.run(a+b)) 42 >>> quit() 至此,Centos7下安装Python3.x和TensorFlow完成。 卸载: 1. sudo pip uninstall protobuf 2. sudo pip uninstall tensorflow
返回至
Centos7 安装Python3、安装TensorFlow以及卸载
。
导航菜单
个人工具
创建账户
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
社区主页
新闻动态
最近更改
随机页面
帮助
华师附中老三届
站群链接
社友网(sn)
产品百科(cpwiki)
产品与服务(sn)
社区支持农业(sn)
工具
链入页面
相关更改
特殊页面
页面信息