服务器配置 jupyter

服务器环境

阿里云

配置

安装依赖,虚拟环境更好

pip3 install jupyter

进入ipython交互界面获取配置文件所需密码

from notebook.auth import passwd

passwd()

配置文件生成与修改

jupyter notebook --generate-config
vim  /root/.jupyter/jupyter_notebook_config.py

参数设置

c.NotebookApp.ip='0.0.0.0'                         # 设置所有ip都可以访问
c.NotebookApp.password ='argon2:$ar...'            # 之前得到的密文密码
c.NotebookApp.open_browser = False                 #  禁止自动打开浏览器
c.NotebookApp.port =9999                          # 服务启动的端口,随便设
c.NotebookApp.allow_root = True                    #不用在启动时加--allow-root
c.NotebookApp.notebook_dir = "/usr/jupyter_files"  #配置启动目录

启动

jupyter notebook

nohup jupyter notebook --allow-root &  #关闭终端后还能运行
#其中nohup表示不挂断地运行命令、 &表示在后台运行 一般两个一起用nohup command &

关闭

ps -aux|grep jupyter-notebook    #查找进程号
kill -9 PID  

插件安装

pip3 install jupyter_contrib_nbextensions
jupyter contrib nbextension install
pip3 install jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable 
jupyter nbextension enable

其它

注意服务器安全组配置以及防火墙放行 开放端口

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值