gpt4 book ai didi

python - Jupyter笔记本权限错误

转载 作者:太空狗 更新时间:2023-10-29 20:35:50 25 4
gpt4 key购买 nike

我在打开 Jupyter 时遇到了一些问题。我刚刚安装了 Anaconda,但是当我尝试在终端中编写“Jupyter notebook”时遇到了和以前一样的错误。

Johans-MBP:~ JDMac$ Jupyter notebook
Traceback (most recent call last):
File "/Users/JDMac/anaconda3/lib/python3.5/site-packages/traitlets/traitlets.py", line 501, in get
value = obj._trait_values[self.name]
KeyError: 'runtime_dir'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/JDMac/anaconda3/bin/jupyter-notebook", line 6, in <module>
sys.exit(notebook.notebookapp.main())
File "/Users/JDMac/anaconda3/lib/python3.5/site-packages/jupyter_core/application.py", line 267, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/Users/JDMac/anaconda3/lib/python3.5/site-packages/traitlets/config/application.py", line 588, in launch_instance
app.initialize(argv)
File "<decorator-gen-7>", line 2, in initialize
File "/Users/JDMac/anaconda3/lib/python3.5/site-packages/traitlets/config/application.py", line 74, in catch_config_error
return method(app, *args, **kwargs)
File "/Users/JDMac/anaconda3/lib/python3.5/site-packages/notebook/notebookapp.py", line 1021, in initialize
self.init_configurables()
File "/Users/JDMac/anaconda3/lib/python3.5/site-packages/notebook/notebookapp.py", line 815, in init_configurables
connection_dir=self.runtime_dir,
File "/Users/JDMac/anaconda3/lib/python3.5/site-packages/traitlets/traitlets.py", line 529, in __get__
return self.get(obj, cls)
File "/Users/JDMac/anaconda3/lib/python3.5/site-packages/traitlets/traitlets.py", line 508, in get
value = self._validate(obj, dynamic_default())
File "/Users/JDMac/anaconda3/lib/python3.5/site-packages/jupyter_core/application.py", line 99, in _runtime_dir_default
ensure_dir_exists(rd, mode=0o700)
File "/Users/JDMac/anaconda3/lib/python3.5/site-packages/ipython_genutils/path.py", line 167, in ensure_dir_exists
os.makedirs(path, mode=mode)
File "/Users/JDMac/anaconda3/lib/python3.5/os.py", line 241, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/Users/JDMac/Library/Jupyter/runtime'

由于我对这一切几乎一无所知,所以我需要一些帮助:)

最佳答案

解决方案是以普通用户在终端上运行以下命令

$ 导出 XDG_RUNTIME_DIR=""然后启动jupyter$jupyter 笔记本

它不会以 root 用户身份运行

关于python - Jupyter笔记本权限错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35878178/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com