ubuntu18.04.3(server)安装python 3.7.4+anaconda+jupyter(远程访问))
安装
镜像源(清华)mirrors.tuna.tsinghua.edu.cn/ubuntu
apt-get update
apt-get upgrade -y
清华源下载anaconda3 https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/ 我们这里下载https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.3.1-Linux-x86_64.sh
wget -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.3.1-Linux-x86_64.sh
bash Anaconda3-5.2.0-Linux-x86_64.sh
Enter 、yes 环境变量 ,yes 提示信息“Do you wish to proceed with the installation of Microsoft VSCode? [yes|no]”,输入no - 重启终端,即可使用Anaconda3 - 重启终端,即可使用Anaconda3 - 重启终端,即可使用Anaconda3 终端输入 python,仍然会显自带版本,执行
sudo gedit ~/.bashrc
export PATH="/home/xupp/anaconda3/bin:$PATH"
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
升级更新
conda update -n base -c defaults conda
conda upgrade --all
Jupyter Notebook
创建Jupyter_notebook环境,方便管理各种库
conda create -n jupyter python=3
激活环境
删除环境
安装jupyter notebook(激活状态)
conda install jupyter notebook
test
jupyter notebook --ip=127.0.0.1 --allow-root
配置远程访问
设置访问密码 设置全局访问 禁用服务端自启浏览器 ipython
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:8361f5f08937:081cdf40730cb5548e2c213ddd36813a53131xxf'
配置
jupyter notebook --generate-config
vi /root/.jupyter/jupyter_notebook_config.py
(注意路径需要修改)c.NotebookApp.ip = '*'
( 使用 / 快速定位 ,并去掉#,使其生效)c.NotebookApp.password = 'sha1:8361f5f08937:081cdf40730cb5548e2c213ddd36813a5313192f'
( 密钥需要修改为自己的 )c.NotebookApp.open_browser = False
(关闭浏览器自启) 测试下吧
jupyter notebook --allow-root http://xxx:8888