Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jupyter notebook permission error

I'm having some issues with opening Jupyter. I just installed Anaconda, but got the same error as before when I try to write "Jupyter notebook" in terminal.

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'

As I'm close to clueless with all of this, I need some assistance over here :)

like image 866
joddm Avatar asked Mar 08 '16 21:03

joddm


People also ask

How do I fix permission error in Jupyter notebook?

The PermissionError: [errno 13] permission denied error occurs when you try to access a file from Python without having the necessary permissions. To fix this error, use the chmod or chown command to change the permissions of the file so that the right user and/or group can access the file.

How do I grant access to my Jupyter notebook?

You can set access control for Jupyter notebooks at the account level and at the object level. This feature is available in the latest version of Jupyter Notebooks. If you are not using the latest version of Jupyter notebooks, you can enable this feature from the Control Panel >> Account Features page.

How do I fix Error 13 in python?

We can solve this error by Providing the right permissions to the file using chown or chmod commands and also ensuring Python is running in the elevated mode permission .

Why Jupyter is not opening?

Jupyter doesn't load or doesn't work in the browserTry in another browser (e.g. if you normally use Firefox, try with Chrome). This helps pin down where the problem is. Try disabling any browser extensions and/or any Jupyter extensions you have installed. Some internet security software can interfere with Jupyter.


1 Answers

the solution is run the following command on the terminal as a normal user

$ export XDG_RUNTIME_DIR="" then start the jupyter $jupyter notebook

it will not work as root user

like image 93
Dejene Avatar answered Oct 12 '22 23:10

Dejene