Linux下安装配置Jupyter notebook

本文详细介绍如何使用pip安装Jupyter Notebook,配置监听地址、端口及禁用自动打开浏览器等高级设置。同时,解决权限错误导致的签名验证失败问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装过程

# 下载
pip install -i https://pypi.douban.com/simple  jupyter

# 生成配置文件
jupyter notebook --generate-config --allow-root
# 配置文件生成在:~/.jupyter/jupyter_notebook_config.py

 # 设置密码 
jupyter notebook password

# 修改配置文件 
# 设置监听地址,一般改为当前主机的ip
sed -ie "s/#c.NotebookApp.ip = 'localhost'/c.NotebookApp.ip = 'IP地址'/g" ~/.jupyter/jupyter_notebook_config.py
# 设置监听端口
sed -ie 's/#c.NotebookApp.port = 8888/c.NotebookApp.port = 8000/g' ~/.jupyter/jupyter_notebook_config.py
# 禁用自动打开浏览器
sed -ie 's/#c.NotebookApp.open_browser = True/c.NotebookApp.open_browser = False/g' ~/.jupyter/jupyter_notebook_config.py

# 启动
jupyter notebook --allow-root 
# 此时打开浏览器,输入 Jupyter服务器的ip:8000
# 进入登陆页面后,输入设置的密码即可登陆

问题:


打开或者new .ipynb文件时报错:

File "/home/user08/miniconda3/envs/study/lib/python3.6/site-packages/traitlets/traitlets.py", line 528, in get
        value = obj._trait_values[self.name]
    KeyError: 'secret'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/home/user08/miniconda3/envs/study/lib/python3.6/site-packages/tornado/web.py", line 1699, in _execute
        result = await result
      File "/home/user08/miniconda3/envs/study/lib/python3.6/site-packages/tornado/gen.py", line 209, in wrapper
        yielded = next(result)
      File "/home/user08/miniconda3/envs/study/lib/python3.6/site-packages/notebook/services/contents/handlers.py", line 112, in get
        path=path, type=type, format=format, content=content,
      File "/home/user08/miniconda3/envs/study/lib/python3.6/site-packages/notebook/services/contents/filemanager.py", line 433, in get
        model = self._notebook_model(path, content=content)
      File "/home/user08/miniconda3/envs/study/lib/python3.6/site-packages/notebook/services/contents/filemanager.py", line 392, in _notebook_model
        self.mark_trusted_cells(nb, path)
      File "/home/user08/miniconda3/envs/study/lib/python3.6/site-packages/notebook/services/contents/manager.py", line 503, in mark_trusted_cells
        trusted = self.notary.check_signature(nb)
      File "/home/user08/miniconda3/envs/study/lib/python3.6/site-packages/nbformat/sign.py", line 438, in check_signature
        signature = self.compute_signature(nb)
      File "/home/user08/miniconda3/envs/study/lib/python3.6/site-packages/nbformat/sign.py", line 413, in compute_signature
        hmac = HMAC(self.secret, digestmod=self.digestmod)
      File "/home/user08/miniconda3/envs/study/lib/python3.6/site-packages/traitlets/traitlets.py", line 556, in __get__
        return self.get(obj, cls)
      File "/home/user08/miniconda3/envs/study/lib/python3.6/site-packages/traitlets/traitlets.py", line 535, in get
        value = self._validate(obj, dynamic_default())
      File "/home/user08/miniconda3/envs/study/lib/python3.6/site-packages/nbformat/sign.py", line 387, in _secret_default
        self._write_secret_file(secret)
      File "/home/user08/miniconda3/envs/study/lib/python3.6/site-packages/nbformat/sign.py", line 397, in _write_secret_file
        with io.open(self.secret_file, 'wb') as f:
    PermissionError: [Errno 13] Permission denied: '/home/user08/.local/share/jupyter/notebook_secret'

解决办法:
 

sudo chmod 777 ~/.local/share/jupyter/

cd ~/.local/share/jupyter/

sudo chmod 777 runtime/

# 重启Jupyter

 

实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip实验CNN数字手写体识别基于python jupyter notebook android (可运行)可安装在手机.zip
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值