Linux安装anaconda3,配置jupyter,在jupyter安装tensorflow环境

一、安装anaconda3

1.1、资源包下载 https://repo.anaconda.com/archive/

或者在服务下载 wget https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh

1.2、执行

chmod +x Anaconda3-2020.02-Linux-x86_64.sh

1.3、执行

bash Anaconda3-2020.02-Linux-x86_64.sh

根据提示输入yes

1.4 确认是否安装成功:
conda --version

4.8.2


列出当前环境
conda  env list

创建虚拟环境
conda create -n py37_tf2 python=3.7

激活环境
source activate py37_tf2

二、配置jupyter

进入 ipython

(py37_tf2) [root@emr-worker-1 jupyter]# jupyter notebook --generate-config

Writing default config to: /root/.jupyter/jupyter_notebook_config.py

(py37_tf2) [root@emr-worker-1 jupyter]# vim /root/.jupyter/jupyter_notebook_config.py

(py37_tf2) [root@emr-worker-1 jupyter]# ipython

Python 3.7.6 (default, Jan 8 2020, 19:59:22)

Type 'copyright', 'credits' or 'license' for more information

IPython 7.12.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from notebook.auth import passwd

In [2]: passwd()

Enter password:

Verify password:

Out[2]: 'sha1:d65b8dxxx
In [3]:

exit()退出ipython环境

进入/mnt/disk1/apps/anaconda3/etc/jupyter

执行

jupyter notebook --generate-config

(py37_tf2) [root@emr-header-1 jupyter]# jupyter notebook --generate-config

Overwrite /root/.jupyter/jupyter_notebook_config.py with default config? [y/N]y

Writing default config to: /root/.jupyter/jupyter_notebook_config.py

(py37_tf2) [root@emr-header-1 jupyter]#

vim /root/.jupyter/jupyter_notebook_config.pyc
c.NotebookApp.ip = '*' # 允许访问此服务器的 IP,星号表示任意 IP

c.NotebookApp.password = u'sha1:d65b8dxxx' # 之前生成的密码 hash 字串

c.NotebookApp.open_browser = False # 运行时不打开本机浏览器

c.NotebookApp.port = 6000 # 使用的端口,随意设置

c.NotebookApp.enable_mathjax = True # 启用 MathJax

前台启动

jupyter notebook

root用户启动

nohup jupyter notebook --allow-root &

三、安装tensorflow==2.2

进入jupter页面执行  http://localhost:6000

pip install tensorflow==2.2

Linux安装anaconda3,配置jupyter,在jupyter安装tensorflow环境_第1张图片

 

 

参考:【1】https://www.cnblogs.com/andylhc/p/9513504.html

【2】https://blog.csdn.net/dongwanli666/article/details/78920059

【3】https://www.cnblogs.com/cord/p/9226641.html

 

你可能感兴趣的:(tensorflow)