You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Conda环境下Jupyter Lab在Documents目录创建笔记本权限被拒问题

问题描述

在Mac终端的Conda环境myenv-env中,从用户根目录执行jupyter lab启动Jupyter Lab可正常运行。但切换至~/Documents目录后启动Jupyter Lab,虽能打开界面,但创建新笔记本时会报错:

"Error Permission Denied: Untitled.ipynb"

已通过“显示简介”确认~/和~/Documents目录自身拥有读写权限,但仅能在根目录创建笔记本,无法在Documents目录及子目录操作。

已尝试操作

参考方案执行以下命令:

sudo chown -R myusername: ~/.local/share/jupyter

但收到错误提示:

chown: /Users/myusername/.local/share/jupyter: No such file or directory

解决方案

  • 先确认Jupyter配置目录位置:在myenv-env环境下执行
    jupyter --config-dir
    
    若输出路径不存在,执行mkdir -p [输出的路径]创建目录。
  • 检查Documents目录的终端实际权限:执行
    ls -ld ~/Documents
    
    确保输出中当前用户权限包含w(读写权限)。
  • 创建并修复Jupyter运行时目录权限:
    mkdir -p ~/.local/share/jupyter
    sudo chown -R myusername:staff ~/.local/share/jupyter
    
    (Mac系统中用户默认组为staff,可根据实际情况替换)
  • 检查Mac系统隐私权限:打开「系统设置」→「隐私与安全性」→「文件和文件夹」,找到终端或Jupyter Lab,勾选「Documents」选项,授予访问权限。
  • 尝试指定工作目录启动Jupyter Lab:
    jupyter lab --notebook-dir=~/Documents
    
    替代先切换目录再启动的方式。

内容的提问来源于stack exchange,提问作者Kristen G.

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 22:52:11