PermissionError: [Errno 13] Permission denied: '/usr/share/jupyter'
See original GitHub issuegurkenglas@Gurkenglas-PC:~/.local/lib/python3.9/site-packages/lenses$ coconut --ipython notebook
Traceback (most recent call last):
File "/home/gurkenglas/.local/lib/python3.9/site-packages/coconut/command/command.py", line 293, in handling_exceptions
yield
File "/home/gurkenglas/.local/lib/python3.9/site-packages/coconut/command/command.py", line 129, in cmd
self.use_args(parsed_args, interact, original_args=args)
File "/home/gurkenglas/.local/lib/python3.9/site-packages/coconut/command/command.py", line 255, in use_args
self.start_jupyter(args.jupyter)
File "/home/gurkenglas/.local/lib/python3.9/site-packages/coconut/command/command.py", line 719, in start_jupyter
custom_kernel_dir = install_custom_kernel()
File "/home/gurkenglas/.local/lib/python3.9/site-packages/coconut/kernel_installer.py", line 64, in install_custom_kernel
os.makedirs(kernel_dest)
File "/usr/lib/python3.9/os.py", line 215, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/usr/lib/python3.9/os.py", line 215, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/usr/lib/python3.9/os.py", line 225, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/share/jupyter'
(you should report this at https://github.com/evhub/coconut/issues/new)
Exiting due to PermissionError.
gurkenglas@Gurkenglas-PC:~/.local/lib/python3.9/site-packages/lenses$ coconut -v
Coconut: Version 1.5.0 [Fish License] running on Python 3.9.5 and Cython
cPyparsing v2.4.5.0.1.2
got coconut via python3.9 -m pip install coconut
.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (8 by maintainers)
Top Results From Across the Web
[Errno 13] Permission denied: '/usr/local/share/jupyter' #68
When I run python -m matlab_kernel install I get this error [Errno 13] Permission denied: '/usr/local/share/jupyter' . However my jupyter is located at ......
Read more >python - Jupyter notebook permission error - Stack Overflow
The permission error may be due to directory is not in 777 mode. Please follow below command, it works for me: sudo chmod...
Read more >sudo: jupyter: command not found & OSError: [Errno 13 ...
If I try to check if jupyter is in my path or not using, I get something in return. So how can I...
Read more >500 error on loading notebook - Jupyter Community Forum
PermissionError : [Errno 13] Permission denied: '/usr/local/share/jupyter/nbconvert/templates/conf.json'. I do see in google discussions on ...
Read more >Python PermissionError: [errno 13] permission denied Solution
The PermissionError: [errno 13] permission denied error occurs when you try to access a file from Python without having the necessary ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would just like to put in a quick update for anyone who finds this and tries to use nix with coconut. I was able to significantly simplify it.
I put it up in a repo at https://github.com/bj0/nix-coconut
If you have nix with flakes support, you can run it directly from there with
nix run github:bj0/nix-coconut
Ok I learned enough to get it to work. For anyone else who’s interested here’s whats what:
I used jupyterWith to create the jupyter environment, but I had to add a custom kernel for coconut. I based it off one of their pre-existing ones, it was pretty straightforward.
I also had to use mach-nix to pull an updated coconut, since the one in nixpkgs is 1.4.3, and I wasn’t sure of all the dependencies for building from scratch.
The files are below, a
shell.nix
file to launch withnix-shell
, and acoconut/default.nix
file that has the kernel definition. I couldn’t find a coconut icon on the doc site so i just copied a random icon from jupyterWith (it’s used when you launch jupyter lab).shell.nix
coconut/default.nix
This works great, launching a coconut+jupyter console. One thing to note is that the way jupyterWith works, there is a separate “shell” environment that is different than the kernel environments, which means coconut is not available in the shell. This means you can’t
coconut --jupyter console
, so you mustjupyter console --kernel coconut_<name>
.I was able to fix this by using jupyterWith’s overlay feature, and with 1.5.0dev82, It worked with warings:
Unfortunately, it also created kernel files in
~/.local/share/jupyter/kernels
, which I didn’t want it to do, so for now I’ll just use what I have above.PS: it’s easy to use the development version with the following changes:
Note that
mach-nix
works off a snapshot of pypi that’s fixed with a revision and hash, so if you want to use a newer dev build than what’s in the snapshot you have to get a new revision/hash from https://github.com/DavHau/pypi-deps-db. Or you can just figure out how to build it from source.