Ubuntu18.04安装Jupyter Notebook远程访问

之前都是使用docker中镜像自带的Jupyter,但是访问不到数据文件夹,就打算在服务器直接装一个

按照正常的方式

1. pip3 install jupyter 

2. jupyter notebook --generate-config  # 生成配置文件

3. 设置密码

python3 # 进入python编译环境

from notebook.auth import passwd

passwd()

Enter password:
Verify password:

Out: 'sha1:xxxxxxxx'

复制那一整串

4. vim ~/.jupyter/jupyter_notebook_config.py   # 插入一下代码,不嫌烦可以把原来的注释取消 

c.NotebookApp.ip='*'  # 允许所有ip访问
c.NotebookApp.password = u'sha1:xxxxxxxxxxxxxx' 
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888 # 访问端口
c.NotebookApp.notebook_dir = '/lab-pool/workspace/' # 指定目录

保存后

jupyter notebook # 启动服务

正常来说 此时从浏览器访问 服务器ip:8888端口,就会跳出来jupyter登录界面,输入密码即可
然而,出现了报错:socket.gaierror: [Errno -2] Name or service not known

查了一下,开启了端口还是一样

解决方法:把ip作为参数一起输入:

jupyter notebook --ip=192.168.1.220
nohup jupyter notebook --ip=192.168.1.220 &     # Session断开也继续运行 

 

 

 

 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值