Jupyter Notebook无法启动,遇PermissionError权限拒绝问题求助
解决Jupyter Notebook在VS Code中无法打开的PermissionError问题
问题描述
我是Python新手,日常使用VS Code学习,目前遇到Jupyter Notebook无法打开的问题,报错信息如下:
[E 2024-11-15 22:50:06.734 ServerApp] Failed to write server-info to C:\Users\48608\AppData\Roaming\jupyter\runtime\jpserver-4920.json: PermissionError(13, 'Permission denied') Traceback (most recent call last): File "C:\Users\48608\anaconda3\Scripts\jupyter-notebook-script.py", line 10, in <module> sys.exit(main()) ^^^^^^ File "C:\Users\48608\anaconda3\Lib\site-packages\jupyter_server\extension\application.py", line 623, in launch_instance serverapp.start() File "C:\Users\48608\anaconda3\Lib\site-packages\jupyter_server\serverapp.py", line 3119, in start self.start_app() File "C:\Users\48608\anaconda3\Lib\site-packages\jupyter_server\serverapp.py", line 3023, in start_app self.write_browser_open_files() File "C:\Users\48608\anaconda3\Lib\site-packages\jupyter_server\serverapp.py", line 2890, in write_browser_open_files self.write_browser_open_file() File "C:\Users\48608\anaconda3\Lib\site-packages\jupyter_server\serverapp.py", line 2913, in write_browser_open_file with open(self.browser_open_file, "w", encoding="utf-8") as f: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PermissionError: [Errno 13] Permission denied: 'C:\\Users\\48608\\AppData\\Roaming\\jupyter\\runtime\\jpserver-4920-open.html'
论坛上的解决方案对我来说过于复杂,希望得到简单易懂的帮助。
解决方案(新手友好)
方法1:以管理员身份运行VS Code
- 关闭当前所有VS Code窗口和终端
- 找到VS Code快捷方式,右键选择「以管理员身份运行」
- 重新打开Jupyter Notebook尝试
方法2:释放被占用的进程
- 按下
Ctrl+Shift+Esc打开任务管理器 - 在「进程」标签里找到包含
jupyter、python或anaconda的进程,右键选择「结束任务」 - 重启VS Code后再打开Jupyter
方法3:修改Jupyter runtime文件夹权限
- 打开文件资源管理器,输入路径:
C:\Users\48608\AppData\Roaming\jupyter\runtime(替换48608为你的用户名) - 右键
runtime文件夹,选择「属性」→「安全」→「编辑」 - 在弹出的窗口中找到你的用户账户,勾选「完全控制」的允许选项,点击「确定」保存设置
方法4:禁用自动生成浏览器打开文件
- 打开VS Code的终端,输入命令:
jupyter server --generate-config
- 终端会输出配置文件的路径,找到这个文件用记事本打开
- 搜索
c.ServerApp.browser_open_file,把该行修改为:
c.ServerApp.browser_open_file = False
- 保存文件后,重启Jupyter Notebook
内容的提问来源于stack exchange,提问作者Damian Chojnacki
相关产品推荐
相关产品推荐

