我安装了 Anaconda,当我尝试通过 Anaconda 或直接从终端打开 jupyter notebook 时,出现了错误 -
Traceback (most recent call last): File
"/home/siddhant/anaconda3/lib/python3.7/site-packages/traitlets/traitlets.py",
line 528, 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
"/home/siddhant/anaconda3/bin/jupyter-notebook", line 11, in
sys.exit(main()) File
"/home/siddhant/anaconda3/lib/python3.7/site-packages/jupyter_core/application.py",
line 268, in launch_instance return super(JupyterApp,
cls).launch_instance(argv=argv, **kwargs) File
"/home/siddhant/anaconda3/lib/python3.7/site-packages/traitlets/config/application.py",
line 663, in launch_instance app.initialize(argv) File "", line 2, in
initialize File
"/home/siddhant/anaconda3/lib/python3.7/site-packages/traitlets/config/application.py",
line 87, in catch_config_error return method(app, *args, **kwargs)
File
"/home/siddhant/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py",
line 1766, in initialize self.init_configurables() File
"/home/siddhant/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py",
line 1380, in init_configurables connection_dir=self.runtime_dir, File
"/home/siddhant/anaconda3/lib/python3.7/site-packages/traitlets/traitlets.py",
line 556, in get return self.get(obj, cls) File
"/home/siddhant/anaconda3/lib/python3.7/site-packages/traitlets/traitlets.py",
line 535, in get value = self._validate(obj, dynamic_default()) File
"/home/siddhant/anaconda3/lib/python3.7/site-packages/jupyter_core/application.py",
line 99, in _runtime_dir_default ensure_dir_exists(rd, mode=0o700)
File
"/home/siddhant/anaconda3/lib/python3.7/site-packages/jupyter_core/utils/init.py",
line 13, in ensure_dir_exists os.makedirs(path, mode=mode) File
"/home/siddhant/anaconda3/lib/python3.7/os.py", line 221, in makedirs
mkdir(name, mode) PermissionError: [Errno 13] Permission denied:
'/home/siddhant/.local/share/jupyter/runtime'
实际上我是 ubuntu 新手,请帮助我在 ubuntu 虚拟机上运行 jupyter notebook
答案1
sudo chown -R user: ~/.local/share/jupyter
user
是您的用户名,以普通用户身份在终端中使用此命令,它将起作用!