Configuración de centos 7 jupyter

Uno, generar el archivo de configuración de jupyter

  • Ejecutando una orden
jupyter notebook --generate-config
  • Los archivos se generarán en el directorio de usuarios
/home/usrname/.jupyter/jupyter_notebook_config.py

Dos, genera la clave

  • Abra ipython o python
In [1]:from notebook.auth import passwd
In [2]:passwd()
# 该密码将是你浏览器访问服务器时需要输入的密码
Enter password: 123
Verify password:123
Out[2]: 'sha1:8361f5f08937:081cdf40730cb5548e2c213ddd36813a5313192f'

Tres, modificar el archivo de configuración

vim ~/.jupyter/jupyter_notebook_config.py
# jupyter默认打开的文件夹,也是该juputer的根文件夹,如果不设置,将会打开用户目录
c.NotebookApp.notebook_dir = '/Data/'
# 运行root账号远程登录访问
c.NotebookApp.allow_root = True
# 服务器的IP地址,切记使用'localhost'
c.NotebookApp.ip = '172.*.*.168'
# 禁用服务器上的浏览器
c.NotebookApp.open_browser = False
# 由python产生的密码hash值,由第二步生成
c.NotebookApp.password = u'sha1:a800c84026a2:1e*****2d1ceec0dd4dac452a164ceb'
# jupyter服务运行的端口号
c.NotebookApp.port = 8888

Cuarto, abra el número de puerto establecido en el archivo de configuración

firewall-cmd --zone=public --add-port=8888/tcp --permanent
sudo systemctl restart firewalld

Cinco, abra la operación de backend de jupyter

nohup jupyter notebook --allow-root

Seis, acceso al navegador jupyter

  • Entrada del navegadorip: puerto,introducir la contraseña123Listo para visitar
172.*.*.168:8888

Supongo que te gusta

Origin blog.csdn.net/KIJamesQi/article/details/115302782
Recomendado
Clasificación