安装anaconda和tensorflow
一、首先下载anaconda,下载:Anaconda2-4.3.1-Linux-x86_64.sh(https://repo.continuum.io/archive/)参考网址:https://www.cnblogs.com/willnote/p/6746499.html
二、安装anaconda,进入下载目录
如果没有修改的话,默认的下载目录是在 /home/下载/下,Ctrl+Alt+T打开终端,输入 cd /home,然后按两次Tab键,终端会自动补上用户名以及该用户名下的文件目录:
可以看到排列出的所有文件夹,继续输入 cd/home/dcrmg/下载 ,进入下载目录:
三. 安装Anaconda
下载的文件是以 .sh 为后缀的,名称比较长,我这里先给它给改名称为 Anaconda.sh。
在终端继续输入 sudo bash Anaconda.sh ,开始执行Anaconda安装。
会要求先输入用户密码,然后是许可文件,直接按Enter继续:
接受许可,输入yes,按回车:
提示默认安装路径是 /home/dcrmg/anaconda2 ,按回车确认,开始安装:
四. 添加环境变量
安装完成之后,会提示是否添加环境变量,输入 yes 后回车:
这样Anaconda安装成功了。终端窗口提示要使环境变量生效,需要重新打开一个终端。在一个新开的终端里输入python,提示信息显示已经不是Linux系统自带的python了:
或者也可以在当前的终端里让刚配置的环境变量生效,方法是在安装Anaconda的终端中输入:
source ~/.bashrc
五、打开jupyter notebook
在终端输入jupyter notebook即可,如下图:
Anaconda仓库镜像
官方下载更新工具包的速度很慢,所以继续添加清华大学 TUNA提供的Anaconda仓库镜像,在终端或cmd中输入如下命令进行添加
1
2
|
$ conda config - - add channels https: / / mirrors.tuna.tsinghua.edu.cn / anaconda / pkgs / free / $ conda config - - set show_channel_urls yes |
备注:如果出现conda命令未找到,查看:https://www.cnblogs.com/chamie/p/10009193.html
Tensorflow安装
在终端或cmd中输入以下命令搜索当前可用的tensorflow版本
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
(可以略掉)$ anaconda search - t conda tensorflow Using Anaconda API: https: / / api.anaconda.org Run 'anaconda show <USER/PACKAGE>' to get more details: Packages: Name | Version | Package Types | Platforms - - - - - - - - - - - - - - - - - - - - - - - - - | - - - - - - | - - - - - - - - - - - - - - - | - - - - - - - - - - - - - - - HCC / tensorflow | 1.0 . 0 | conda | linux - 64 HCC / tensorflow - cpucompat | 1.0 . 0 | conda | linux - 64 HCC / tensorflow - fma | 1.0 . 0 | conda | linux - 64 SentientPrime / tensorflow | 0.6 . 0 | conda | osx - 64 : TensorFlow helps the tensors flow acellera / tensorflow - cuda | 0.12 . 1 | conda | linux - 64 anaconda / tensorflow | 1.0 . 1 | conda | linux - 64 anaconda / tensorflow - gpu | 1.0 . 1 | conda | linux - 64 conda - forge / tensorflow | 1.0 . 0 | conda | linux - 64 , win - 64 , osx - 64 : TensorFlow helps the tensors flow creditx / tensorflow | 0.9 . 0 | conda | linux - 64 : TensorFlow helps the tensors flow derickl / tensorflow | 0.12 . 1 | conda | osx - 64 dhirschfeld / tensorflow | 0.12 . 0rc0 | conda | win - 64 dseuss / tensorflow | | conda | osx - 64 guyanhua / tensorflow | 1.0 . 0 | conda | linux - 64 ijstokes / tensorflow | 2017.03 . 03.1349 | conda, ipynb | linux - 64 jjh_cio_testing / tensorflow | 1.0 . 1 | conda | linux - 64 jjh_cio_testing / tensorflow - gpu | 1.0 . 1 | conda | linux - 64 jjh_ppc64le / tensorflow | 1.0 . 1 | conda | linux - ppc64le jjh_ppc64le / tensorflow - gpu | 1.0 . 1 | conda | linux - ppc64le jjhelmus / tensorflow | 0.12 . 0rc0 | conda, pypi | linux - 64 , osx - 64 : TensorFlow helps the tensors flow jjhelmus / tensorflow - gpu | 1.0 . 1 | conda | linux - 64 kevin - keraudren / tensorflow | 0.9 . 0 | conda | linux - 64 lcls - rhel7 / tensorflow | 0.12 . 1 | conda | linux - 64 marta - sd / tensorflow | 1.0 . 1 | conda | linux - 64 : TensorFlow helps the tensors flow memex / tensorflow | 0.5 . 0 | conda | linux - 64 , osx - 64 : TensorFlow helps the tensors flow mhworth / tensorflow | 0.7 . 1 | conda | osx - 64 : TensorFlow helps the tensors flow miovision / tensorflow | 0.10 . 0.gpu | conda | linux - 64 , osx - 64 msarahan / tensorflow | 1.0 . 0rc2 | conda | linux - 64 mutirri / tensorflow | 0.10 . 0rc0 | conda | linux - 64 mwojcikowski / tensorflow | 1.0 . 1 | conda | linux - 64 rdonnelly / tensorflow | 0.9 . 0 | conda | linux - 64 rdonnellyr / r - tensorflow | 0.4 . 0 | conda | osx - 64 test_org_002 / tensorflow | 0.10 . 0rc0 | conda | Found 32 packages |
选择一个较新的CPU或GPU版本,如jjh_cio_testing/tensorflow-gpu的1.0.1版本,输入如下命令查询安装命令
1
2
3
4
5
6
7
8
9
10
11
12
|
(可以略掉)$ anaconda show jjh_cio_testing / tensorflow - gpu Using Anaconda API: https: / / api.anaconda.org Name: tensorflow - gpu Summary: Access: public Package Types: conda Versions: + 1.0 . 1 To install this package with conda run: conda install - - channel https: / / conda.anaconda.org / jjh_cio_testing tensorflow - gpu |
使用最后一行的提示命令进行安装
1
2
3
4
5
6
7
8
9
10
11
12
|
$ conda install - - channel https: / / conda.anaconda.org / jjh_cio_testing tensorflow - gpu = = 1.3 . 0 Fetching package metadata ............. Solving package specifications: . Package plan for installation in environment / home / will / anaconda2: The following packages will be SUPERSEDED by a higher - priority channel: tensorflow - gpu: 1.0 . 1 - py27_4 https: / / mirrors.tuna.tsinghua.edu.cn / anaconda / pkgs / free - - > 1.0 . 1 - py27_4 jjh_cio_testing Proceed ([y] / n)? |
conda会自动检测安装此版本的Tensorflow所依赖的库,如果你的Anaconda缺少这些依赖库,会提示你安装。因为我之前已经安装过了,所以这里只提示我安装Tensorflow。输入y并回车之后等待安装结束即可
- 可以选择次高版本的Tensorflow安装,因为最新版本可能清华 TUNA的仓库镜像库没有及时更新,而官方更新连接总是失败,我最开始选择了jjhelmus/tensorflow-gpu的1.0.1版本,其他依赖 库清华 TUNA的仓库镜像有资源,而到最后jjhelmus/tensorflow-gpu版本的Tensorflow安装包总是下载不下来,尝试20多次之后 换了一个1.0.0的版本,终于顺利安装成功
进入python,输入
1
|
import tensorflow as tf |
如果没有报错说明安装成功。
(2)PIP安装tensorflow
安装完CUDA 8 和 cuDNN 5后, 在终端输入 sudo apt-get install libcupti-dev(参考:https://www.cnblogs.com/zengcv/p/6564517.html)
Ubuntu14.04默认安装的Python2.7.6
先安装Python库
1
|
sudo apt - get install python - pip python - dev |
安装tensorflow:
(1)在线安装
sudo pip install https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.0.1-cp27-none-linux_x86_64.whl
(2)下载安装(由于Ubuntu系统下,网上比较慢,可以在windows下载。推荐这种安装方法)
sudo pip install tensorflow_gpu-1.0.1-cp27-none-linux_x86_64.whl
(下载地址:https://pypi.org/project/tensorflow-gpu/1.0.1/#files)
参考文献:
1.https://www.cnblogs.com/chamie/p/8876271.html
2.https://www.cnblogs.com/hezhiyao/p/8328634.html
安装anaconda和tensorflow的更多相关文章
- 安装anaconda与tensorflow
在安装Anaconda之前,有的已经安装过一个Python版本了,但是又不想删除这个Python版本,该怎么办呢? 安装anaconda与tensorflow一条龙 jupyter notebook ...
- windows10安装anaconda,配置tensorflow
1.安装anaconda 3.5.5 默认安装,注意,把添加到path勾选上,其他默认安装(能搜到这篇文章,相信大家都有过变成经验,这些环境变量的重要性就不要窝在多说了) 2.以管理员身份,打开ana ...
- 在 Ubuntu16.04上安装anaconda+Spyder+TensorFlow(支持GPU)
TensorFlow 官方文档中文版 http://www.tensorfly.cn/tfdoc/get_started/introduction.html https://zhyack.github ...
- MacOS上安装Anaconda+Pycharm+TensorFlow+Keras
一.安装Anaconda 登录https://www.anaconda.com/download/#macos,下载Anaconda3-5.3.1-MacOSX-x86_64.pkg 二.安装Pych ...
- Ubuntu下安装Anaconda和tensorflow
官方指南:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/docs_src/install/install_linux. ...
- 安装anaconda和tensorflow(windows)
Anaconda安装时勾选All User和启用环境变量可切换为清华镜像conda config --add channels https://mirrors.tuna.tsinghua.edu.cn ...
- windows下安装anaconda和tensorflow
anaconda确实很好用,省去了很多麻烦,现在我个人推荐直接使用anaconda. anaconda的特点:可以存在多个python环境,要使用某一个环境的话,就需要切换到这个环境,安装.卸载包都是 ...
- 关于win系统下Anaconda与TensorFlow的安装相关事宜以及错误:ImportError: No module named 'tensorflow'的解决
1.安装TensorFlow之前应该先安装Anaconda,不需要安装python,否则会出问题,我安装的版本是Anaconda3-4.2.0-Windows-x86_64,在这个链接上可以找到--h ...
- Windows中Anaconda,Tensorflow 和 Pycharm的安装和配置
Anaconda完全入门指南 https://www.jianshu.com/p/eaee1fadc1e9 [安装不要按此条链接进行] Windows中 Anacond ...
随机推荐
- java容器基础
总结一下学过的java容器知识. 一.java容器框架 由于之前学习的java容器类比较混乱,先简单的整理一下java集合框架. 首先,像这种图,网上到处都是,因为这个也算比较准确吧,我也懒得自己画了 ...
- Pyhton学习——Day36
#异步IO——Asynchronous#异步效率最高,特点:全程无阻塞# 在说明synchronous IO和asynchronous IO的区别之前,需要先给出两者的定义.# Stevens给出的定 ...
- .net基础总复习(2)
第二天 文件操作常用类 File类 //操作文件的 //复制.剪切.创建.移除 //File.Create(@"C:\Users\BDSOFT\Desktop\new.txt" ...
- vue 阿里云上传组件
vue 阿里云上传组件 Vue.js上传图片到阿里云OSS存储 测试项目git地址 本测试项目启动方法 示例链接 组件配置项 实践解释 本文主要介绍如何 在vue项目中使用web 直传方式上传阿里云o ...
- VUE:路由
VUE:路由 一.说明 1)官方提供的用来实现SPA的vue插件 2)github:https://github.com/vuejs/vue-router 3)中文文档:http://router.v ...
- IIC 原理讲解
IIC具体是什么这里我就不细说了,只收集一些关于IIC的原理. IIC总线优点是节约总线数,稳定,快速, 是目前芯片制造上非常 流行的一种总线,大多数单片机已经片内集成了IIC总线接口,无 需用户自己 ...
- js中的json操作
js中的json操作 JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式,采用完全独立于语言的文本格式,是理想的数据交换格式.同时,JSON是 JavaScr ...
- Nginx +Tomcat 实现动静态分离(转)
Nginx +Tomcat 实现动静态分离 动静态分离就是Nginx处理客户端的请求的静态页面(html页面)或者图片,Tomcat处理客户端请求的动态页面(jsp页面),因为Nginx处理的静态页面 ...
- 《从零開始学Swift》学习笔记(Day 46)——下标重写
原创文章.欢迎转载.转载请注明:关东升的博客 下标是一种特殊属性. 子类属性重写是重写属性的getter和setter訪问器,对下标的重写也是重写下标的getter和setter訪问器. 以下看一个演 ...
- atitit。流程图的设计与制作 attilax 总结
atitit.流程图的设计与制作 attilax 总结 1. 流程图的规范1 2. 画图语言2 2.1. atitit.CSDN-markdown编辑器2 2.2. js-sequence-diagr ...