Ubuntu – Cannot open jupyter notebook on ubuntu18.04-VirtualMachine (PermissionError: [Errno 13] )

jupyter

I installed Anaconda, and when I am trying to open jupyter notebook either through Anaconda or directly form the terminal I am getting the error –

 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'

Actually I am new to ubuntu, please help me tto run jupyter notebook on my ubuntu VirtualMachine

Best Answer

  • sudo chown -R user: ~/.local/share/jupyter
    

    user is your username, use this command in the terminal as a normal user, it will work!

  • Related Question