anaconda安装
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
sh Anaconda3-2021.05-Linux-x86_64.sh
vim ~/.bashrc
export PATH=/home/XXX/anaconda3/bin:$PATH
source ~/.bashrc
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
更新库
conda update –all
更新 conda
conda update conda
anaconda基础命令
conda create --name 环境名称 python=3.7
conda env list
source activate 环境名称
source deactivate
jupyter安装
source activate 环境名称
conda install jupyter
mkdir /opt/tool/jupyter
cd /opt/tool/jupyter
jupyter notebook --generate-config
(base) [root@node01]# python
Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from notebook.auth import passwd
>>> passwd()
Enter password:
Verify password:
'sha1:113cd9944dec:5ca48e5c78506adf3aebe298817984f93752ca70'
>>>
vim ~/.jupyter/jupyter_notebook_config.py
# 运行所有IP访问
c.NotebookApp.ip = '*'
c.NotebookApp.allow_root = True
# 启动时是否自动打开浏览器
c.NotebookApp.open_browser = False
# 指定端口号
c.NotebookApp.port = 8888
# 密码设置
c.NotebookApp.password = 'sha1:113cd9944dec:5ca48e5c78506adf3aebe298817984f93752ca70'
# jupyter notebook工作目录
c.ContentsManager.root_dir = '/home/spark/tmp/
nohup jupyter notebook > jupyter.log 2>&1 &
ps -aux | grep jupyter
netstat -nltp