linux虚拟机jupyter卡,远程访问虚拟机 jupyter notebook

在服务器上配置jupyter, 方便我们远程登录.

第一步:安装jupyter, pip3 install jupyter (此处使用的是python3)

第二步:生成配置文件jupyter notebook --generate-config

gz@ubuntu:~$ cd .jupyter/

gz@ubuntu:~/.jupyter$ ll

total 12

drwxr-xr-x 2 gz gz 4096 Sep 3 14:56 ./

drwxr-xr-x 36 gz gz 4096 Sep 4 11:28 ../

-rw-r--r-- 1 gz gz 26 Sep 3 14:56 migrated

gz@ubuntu:~/.jupyter$ jupyter notebook --generate-config

jupyter: command not found

gz@ubuntu:~/.jupyter$ workon py3_face

(py3_face) gz@ubuntu:~/.jupyter$ jupyter notebook --generate-config

Writing default config to: /home/gz/.jupyter/jupyter_notebook_config.py

(py3_face) gz@ubuntu:~/.jupyter$ ll

total 48

drwxr-xr-x 2 gz gz 4096 Sep 4 11:35 ./

drwxr-xr-x 36 gz gz 4096 Sep 4 11:28 ../

-rw-rw-r-- 1 gz gz 33341 Sep 4 11:35 jupyter_notebook_config.py

-rw-r--r-- 1 gz gz 26 Sep 3 14:56 migrated

(py3_face) gz@ubuntu:~/.jupyter$

第三步:生成密钥 打开python3

>>> from notebook.auth import passwd

>>> passwd()

Enter password:

Verify password:

'sha1:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

>>>

修改配置文件

vim + ~/.jupyter/jupyter_notebook_config.py

添加内容如下:

c.NotebookApp.ip="192.168.xxx.xxx"

c.NotebookApp.password = u"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # 刚才复制的那个密文

c.NotebookApp.open_brower = False # # 禁止自动打开浏览器

c.NotebookApp.port = 8888 #随便指定一个端口

这里注意:c.NotebookApp.ip='104.222.1.1',这里应该填写你服务器的ip,网上的全部都是c.NotebookApp.ip='*',我照着测试后踩了很多坑。

输入前面设置的密码。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值