conda安装jupyter notebook,解决无法远程

本文介绍了如何使用conda安装jupyter notebook,并详细阐述了如何配置环境以支持远程访问,包括生成配置文件、设置密码、修改配置文件以允许远程连接。此外,还提到了代码自动补全、添加多个kernel、安装jupyter_contrib_nbextension扩展以及解决tornado和nbconvert版本问题的方法。推荐的实用插件有Table of Contents、Variable Inspector和ExecuteTime。
摘要由CSDN通过智能技术生成


系统:CentOS

conda安装jupyter

conda install ipykernel
conda install jupyter

激活conda建立的环境(conda create),如paddle

conda activate paddle

将新建的环境写入notebook中

paddle为你的环境名;"python3"是你想要它在jupyter notebook中显示的名字,根据自己情况更改这两个值,其他的不变

python -m ipykernel install --user --name paddle --display-name "python3"

生成配置文件

jupyter notebook --generate-config

生成密码

$ jupyter notebook password
Enter password:  yourpassword  #输入密码
Verify password: yourpasswordagain   #再次输入密码确认
#运行后结果
[NotebookPasswordApp] Wrote hashed password to /root/.jupyter/jupyter_notebook_config.json    #密码被保存的位置

修改配置文件

设置远程访问、初始目录、端口号、是否打开浏览器

vim /root/.jupyter/jupyter_notebook_config.py,在内容开头添加:

c.NotebookApp.ip='*'    # 就是设置所有ip地址皆可访问
c.NotebookApp.open_browser = False #禁止自动打开浏览器
c.NotebookApp.port =8089 # 指定一个可用端口,也可以是其他闲置的端
c.NotebookApp.notebook_dir = '/root/workspace/' #设置根目录,限制访问
c.NotebookApp.allow_remote_access = True #远程访问

启动服务

jupyter notebook
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值