CentOS系统中配置jupyter notebook并能使用外网访问

Jupyter Notebook是一个交互式笔记本,支持运行 40 多种编程语言。Jupyter Notebook 的本质是一个 Web 应用程序,便于创建和共享文学化程序文档,支持实时代码,数学方程,可视化和 markdown。 用途包括:数据清理和转换,数值模拟,统计建模,机器学习等等。

一 jupyter 安装

首先登陆腾讯云服务器的centos系统,输入:

pip install jupyter jupyterlab

CentOS系统中配置jupyter notebook并能使用外网访问_第1张图片

出现这种情况,需要安装pip文件,输入以下代码:

wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
pip -V

CentOS系统中配置jupyter notebook并能使用外网访问_第2张图片

发现pip已经安装成功,然后输入“pip install jupyter jupyterlab”指令

二 jupyter外网访问的密码设置

输入以下指令:

ipython
from notebook.auth import passwd
passwd()

设置登录密码后,将密钥保存。

三 生成并修改配置文件

先按control+D,再输入y确认退出。

生成配置文件,输入:

jupyter lab --generate-config

打开FileZilla客户端,连接上腾讯云的centos系统,在窗口文件中找到如下图中的文件(刚刚生成的配置文件):

CentOS系统中配置jupyter notebook并能使用外网访问_第3张图片

将下载后的文件用Xcode打开,将如下内容进行更改

CentOS系统中配置jupyter notebook并能使用外网访问_第4张图片

将更改后的文件通过FileZilla进行上传,并将原来的文件进行覆盖

四 添加服务器规则

打开腾讯云,点击安全组点击新建规则,如下:

CentOS系统中配置jupyter notebook并能使用外网访问_第5张图片

点击【修改规则】后,点击【新建规则】

CentOS系统中配置jupyter notebook并能使用外网访问_第6张图片

五 启动jupyter,并进行远程访问

启动jupyter

jupyter lab --allow-root

打开浏览器,输入:http://公网IP地址:8889

CentOS系统中配置jupyter notebook并能使用外网访问_第7张图片

输入密码后:

CentOS系统中配置jupyter notebook并能使用外网访问_第8张图片

你可能感兴趣的:(CentOS系统中配置jupyter notebook并能使用外网访问)