• Linux下配置python Jupyter远程访问


    1、下载

    可在地址 https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ 选择下载相应安装包

    2、安装

    安装好后,创建文件夹

    创建一个目录(jupyter notebook工作目录)

    mkdir jupyter_notebook

    生成配置文件

    jupyter-notebook --generate-config

    生成密码

    from notebook.auth import passwd

    passwd()

    会生成一个sha1加密的密码 这个后面要用 保存一下

    修改配置文件

    vim /root/.jupyter/jupyter_notebook_config.py
    在jupyter_notebook_config.py中最下面添加一下配置
    c.NotebookApp.ip='*' # *代表所有机器都可访问,或者输入服务ip
    c.NotebookApp.password = u'sha1:......' # 把引号中的内容替换为刚刚生成的sha1开头的密码
    c.NotebookApp.notebook_dir = u'/root/jupyter_notebook' # 第一步创建的工作目录
    c.NotebookApp.open_browser = False
    c.NotebookApp.port = 8888
    c.NotebookApp.allow_root = True
    :wq 保存退出
    

      

    修改密码并启动服务

    由于上面生成的密码太长,所以修改一个简单的密码
    jupyter notebook password
    输入2次新密码
    为了使密码生效,防止jupyter notebook不允许以root方式启动,我们需要在首次访问需要加入参数 
    nohup jupyter-notebook --allow-root --config=/root/.jupyter/jupyter_notebook_config.py &
    第二次启动就不用--config这个参数了
    nohup jupyter-notebook --allow-root &启动即可
    

      

    打开浏览器输入ip:8888就可以看到jupyter notebook的页面了

    输入密码就可以使用jupyter notebook了

  • 相关阅读:
    学习笔记1—多线程相关笔记
    【Java并发编程一】线程安全问题
    Intellij IDEA配置优化--转载
    idea使用阿里工具优化代码+阿里开发手册
    Navicat Premium 12.1.12.0安装与激活
    H5分享功能
    excel导出使用get请求参数过长问题
    百度地图Web引用
    idea通过mapper快速定位到xml文件
    Win10企业版永久激活方法(cmd命令)
  • 原文地址:https://www.cnblogs.com/lvpengbo/p/15534839.html
Copyright © 2020-2023  润新知