首先下载anaconda3镜像
清华大学开源软件镜像站下载地址: https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ 下拉到最低端选择Linux,选择最新版(32/64位)下载。
在Terminal中执行以下命令:
bash Anaconda3-4.2.0-Linux-x86_64.sh
当你出现类似界面,证明Anaconda3已安装成功,输入“no”取消安装 VSCode,因为我们后续将会安装PyCharm作为IDE。
添加环境变量:
打开/.bashrc:
$ gedit ./.bashrc
在.bashrc文件末尾加上anaconda路径,保存:
export PATH=~/anaconda3/bin:$PATH
使环境变量生效:
$ source ~/.bashrc
下面安装Pycharm
window系统下的安装和激活
https://www.cnblogs.com/jpr-ok/archive/2019/02/15/10383615.html
首先去PyCharm官网下载安装包,选择Linux版本下载
https://www.jetbrains.com/pycharm/download/#section=linux
激活查看下面网站,持续更新
https://blog.csdn.net/u010650631/article/details/83192543
修改 /etc 目录下的 hosts 文件
linux/mac/osx:
sudo vim /etc/hosts
windows:
C:\Windows\System32\drivers\etc
在hosts文件中添加以下信息
0.0.0.0 https://account.jetbrains.com:443
注意!:要删掉之前加入的“0.0.0.0 account.jetbrains.com”及“0.0.0.0 www.jetbrains.com”,如果之前没有在 hosts 文件里加入就不用管
打开cmd终端,输入ipconfig /flushdns,然后回车刷新dns缓存
启动 pycharm 选择 Activate code 进行激活
复制以下信息(注册码有效期至2019年11月)
YZVR7WDLV8-eyJsaWNlbnNlSWQiOiJZWlZSN1dETFY4IiwibGljZW5zZWVOYW1lIjoiamV0YnJhaW5zIGpzIiwiYXNzaWduZWVOYW1lIjoiIiwiYXNzaWduZWVFbWFpbCI6IiIsImxpY2Vuc2VSZXN0cmljdGlvbiI6IkZvciBlZHVjYXRpb25hbCB1c2Ugb25seSIsImNoZWNrQ29uY3VycmVudFVzZSI6ZmFsc2UsInByb2R1Y3RzIjpbeyJjb2RlIjoiSUkiLCJwYWlkVXBUbyI6IjIwMTktMTEtMjYifSx7ImNvZGUiOiJBQyIsInBhaWRVcFRvIjoiMjAxOS0xMS0yNiJ9LHsi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tgiwuG7M49LXp4zQVlQnFmWU1wwGvVhq5R63Rpjx1zjGUhcXgayu7+9zMUW596Lbomsg8qVve6euqsrFicYkIIuUu4zYPndJwfe0YkS5nY72SHnNdbPhEnN8wcB2Kz+OIG0lih3yz5EqFhld03bGp222ZQCIghCTVL6QBNadGsiN/lWLl4JdR3lJkZzlpFdiHijoVRdWeSWqM4y0t23c92HXKrgppoSV18XMxrWVdoSM3nuMHwxGhFyde05OdDtLpCv+jlWf5REAHHA201pAU6bJSZINyHDUTB+Beo28rRXSwSh3OUIvYwKNVeoBY+KwOJ7WnuTCUq1meE6GkKc4D/cXmgpOyW/1SmBz3XjVIi/zprZ0zf3qH5mkphtg6ksjKgKjmx1cXfZAAX6wcDBNaCL+Ortep1Dh8xDUbqbBVNBL4jbiL3i3xsfNiyJgaZ5sX7i8tmStEpLbPwvHcByuf59qJhV/bZOl8KqJBETCDJcY6O2aqhTUy+9x93ThKs1GKrRPePrWPluud7ttlgtRveit/pcBrnQcXOl1rHq7ByB8CFAxNotRUYL9IF5n3wJOgkPojMy6jetQA5Ogc8Sm7RG6vg1yow==
终极激活方法
进入http://lookdiv.com/里面的钥匙就是lookdiv.com。
最后安装tensorflow-gpu
1.创建anaconda中的一个环境:
conda create --name py36-tensorflow python=3.6
conda info --envs#显示以下内容表示环境创建成功# conda environments:
#
base * /home/dell/anaconda3
py36-tensorflow /home/dell/anaconda3/envs/py36-tensorflow
2.进入创建的环境
dell@dell-XPS-8930:~$ source activate py36-tensorflow
(py36-tensorflow) dell@dell-XPS-8930:~$
3.神器jupyter notebook
anaconda默认安装了一个python开发神器,Jupyter Notebook,(此前被称为 IPython notebook)是一个交互式笔记本,支持运行 40 多种编程语言。接下来,我们就用它来写一个tensorflow 的 helloworld ,验证我们之前的安装是否成功。
在终端中键入jupyter notebook
(root) forest@forest-MS-7A20:~$ jupyter notebook
在弹出的浏览器窗口中,选择New, Python 2
使用清华开源镜像安装tensorflow
安装tensorflow时,如果使用直接安装速度相对较慢,采取清华大学的镜像会提高速度。
GPU版本安装方法:
pip install tensorflow-gpu==1.11.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
也可以直接把清华源添加进来,一劳永逸。
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
参考:https://www.jianshu.com/p/98028ef0c52e