coconut: PermissionError: [Errno 13] Permission denied: '/usr/share/jupyter'
gurkenglas@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.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (8 by maintainers)
Commits related to this issue
- Improve errmsg for kernel PermissionError Resolves #585. — committed to evhub/coconut by evhub 3 years ago
- Improve kernel install error messages Resolves #585. — committed to evhub/coconut by evhub 3 years ago
- Improve error messages Resolves #585. — committed to evhub/coconut by evhub 3 years ago
- Improve errmsg for kernel PermissionError Resolves #585. — committed to evhub/coconut by evhub 3 years ago
- Improve kernel install error messages Resolves #585. — committed to evhub/coconut by evhub 3 years ago
- Improve error messages Resolves #585. — committed to evhub/coconut by evhub 3 years ago
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-coconutOk 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.nixfile to launch withnix-shell, and acoconut/default.nixfile 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.nixcoconut/default.nixThis 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-nixworks 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.