Linux环境安装Anaconda3,并配置Jupyter Notebook远程访问

Anaconda简介

Anaconda 是一个用于科学计算的 Python 发行版,支持 Linux, Mac, Windows, 包含了众多流行的科学计算、数据分析的 Python 包。

Anaconda 安装包可以到 https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ 下载。

安装

  1. 下载Anaconda3-2020.07-Linux-x86_64.sh包

    $ wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2020.07-Linux-x86_64.sh
    
  2. 执行安装包安装,根据提示完成安装

    $ bash Anaconda3-2020.07-Linux-x86_64.sh
    
  3. 关闭当前shell连接,重新连接liunx,执行命令测试

    $ python3
    

启动Jupyter Notebook远程访问

  1. 生成配置文件

    $ jupyter notebook --generate-config
    
  2. 准备Hash密码

    # 进入ipython环境
    $ ipython
    Python 3.8.3 (default, Jul  2 2020, 16:21:59)
    Type 'copyright', 'credits' or 'license' for more information
    IPython 7.16.1 -- An enhanced Interactive Python. Type '?' for help.
    
    In [1]: from notebook.auth import passwd
    
    In [2]: passwd()
    Enter password:
    Verify password:
    Out[2]: 'sha1:a9eaaf890825:5c50b341fc3f516b8d622d180ce06db8f40882dc'
    
  3. 修改配置文件

    $ vi /home/hadoop/.jupyter/jupyter_notebook_config.py 
    
    # 配置内容
    # Set ip to '*' to bind on all interfaces (ips) for the public server
    c.NotebookApp.ip = '*'
    c.NotebookApp.password = u'sha1:a9eaaf890825:5c50b341fc3f516b8d622d180ce06db8f40882dc'
    c.NotebookApp.open_browser = False
    c.NotebookApp.allow_remote_access = True
    # 共享目录
    c.NotebookApp.notebook_dir = '/home/hadoop/share'
    
    # It is a good idea to set a known, fixed port for server access
    c.NotebookApp.port = 8899
    
  4. 启动Jupyter Notebook

    $ jupyter notebook
    
  5. 访问http://ip:8899
    在这里插入图片描述

参考:官网Running a notebook server

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

黄旺鑫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值