centos7 jupyter notebook 远程配置

Anaconda 安装

Anaconda:https://www.anaconda.com/

下载地址: https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh

赋予执行权限:

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

配置环境变量:

export ANACONDA_HOME=/data/anaconda3

export PATH=$ANACONDA_HOME/bin:$PATH

创建新的环境

conda create -n pyspark python=3.7

激活

conda activate pyspark

Jupyter Notebook 配置

安装

pip install jupyter

获取notebook配置文件

jupyter notebook --generate-config


config

打开ipython,设置密码

```

from notebook.auth import passwd

passwd()

```

ipython

打开/root/.jupyter/jupyter_notebook_config.py 并设置以下内容

## The IP address the notebook server will listen on. 设置访问ip

c.NotebookApp.ip = '*'

## The directory to use for notebooks and kernels.  设置默认目录

c.NotebookApp.notebook_dir = '/data/project/anaconda'

# The string should be of the form type:salt:hashed-password.  配置密码,复制上步的hash值

c.NotebookApp.password = u'sha1:*************************************************'

## The port the notebook server will listen on.设置端口

c.NotebookApp.port = 8888 ·

你可能感兴趣的:(centos7 jupyter notebook 远程配置)