zoukankan      html  css  js  c++  java
  • 服务器配置jupyter notebook

    服务器配置jupyter notebook

    1. 配置
    • 系统:腾讯云的轻量级服务器(学生优惠) CentOS 7.6
    • python版本:自带的python3(python3.6.8)
    • 登录云服务器后,自带python有python2和python3两个版本,我们只是用python3,所以在命令行python3和pip3安装都需要带上数字“3”
    1. 安装jupyter
    (终端):pip3 install Jupyter
    
    1. 创建文件夹
    (终端):mkdir jupyter_notebook
    
    1. 生成Jupyter Notebook配置文件
    (终端):jupyter notebook --generate-config
    
    1. 设置Jupyter Notebook密码
    (终端):python3
    
    (python3):from IPython.lib import passwd
    (python3):passwd()
    
    # 根据提示设置密码
    
    1. 设置服务器配置文件
    (终端):vim ~/.jupyter/jupyter_notebook_config.py
    #需要在末端添加一下配置信息:
    c.NotebookApp.ip = '*' #所有绑定服务器的IP都能访问,若想只在特定ip访问,输入ip地址即可
    c.NotebookApp.port = 80 #默认是8888,图方便直接设80端口
    c.NotebookApp.open_browser = False #我们并不想在服务器上直接打开Jupyter Notebook,所以设置成False
    c.NotebookApp.notebook_dir = '/root/jupyter_notebook' #这里是设置Jupyter的根目录,若不设置将默认root的根目录,不安全
    c.NotebookApp.allow_root = True # 为了安全,Jupyter默认不允许以root权限启动jupyter 
    
    1. 强行重置了jupyter notebook的密码,这是为了后面踩坑
    (终端):jupyter notebook password
    #根据提示设置密码
    
    1. 启动jupyter远程服务器
    (终端):jupyter notebook
    
    #或者后台运行:
    (终端):nohup jupyter notebook --allow-root > jupyter.log 2>&1 &
    
    #终止进程:
    (终端):ps -a
    (终端):kill -9 pid
    
    1. 远程访问直接输入ip地址访问即可,或者设置了域名解析可以通过域名访问
  • 相关阅读:
    MySQL错误 1030-Got error 28 from storage engine
    电脑开机无反应 不显示BIOS 硬件没问题
    python错误 import: unable to open X server
    Python 错误 invalid command 'bdist_wheel' & outside environment /usr
    Cento 7安装 Failed to execute /init
    笔记《鸟哥的Linux私房菜》5 首次登入与在线求助 man
    Scrapy XPath语法
    Linux 用户操作
    Mysql 表修改
    Ubuntu 配置 Python环境 IPython
  • 原文地址:https://www.cnblogs.com/thgpddl/p/14330631.html
Copyright © 2011-2022 走看看