jupyter notebook安装

# 安装jupyter
conda install jupyter notebook
# 键入ipython,进入ipython操作环境
$ ipython
#引入passwd模块
from jupyter_server.auth import passwd
$ from notebook.auth import passwd
#键入passwd()
$ passwd()
jupyter notebook --generate-config
# 密码将保存在以下文件中,将复制到py文件
$ cat ~/.jupyter/jupyter_notebook_config.json
# 修改配置文件
vim ~/.jupyter/jupyter_notebook_config.py
#允许远程访问
c.NotebookApp.allow_remote_access = True
#允许所有IP都可访问(在c.NotebookApp.allow_remote_access = True后手动添加)
c.NotebookApp.ip = '*'
#修改打开后的根目录,定义为服务器上文件的根目录root
c.NotebookApp.notebook_dir = '/root'
#将开启jupyter后在服务器上打开浏览器的选项设置为False
c.NotebookApp.open_browser = False
#将生成的密钥写进password中
c.NotebookApp.password = 'argon2:$argon2id$v=19$m=10240,t=10,p=8$xxxx+g$ltIajAyniI0eVvBFF2IxIg'
#指定访问端口
c.NotebookApp.port = 8888
# 查看防火墙状态
systemctl status firewalld
# 开放8888端口
firewall-cmd --zone=public --add-port=8888/tcp —permanent
firewall-cmd --zone=public --add-port=8088/tcp --permanent
# 重启防火墙
systemctl restart firewalld
# 重启jupyter
netstat -nlp | grep 8888
Kill -9 xxx
conda activate py36
nohup jupyter notebook --allow-root > jupyter.log 2>&1 &
  
# 浏览器查看 http://127.0.0.1:8888
# Jupyter notebook 添加kernel
# 安装ipykernel
pip install ipykernel
# 创建环境([-m module-name];-user选项,将配置文件生成在本账户的家目录下)
python -m ipykernel install --user --name py36 --display-name 'py36'
# 查看当前的kernel列表¬
jupyter kernelspec list
# 删除kernel
jupyter kernelspec remove py36
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值