jupyter-c-kernel icon indicating copy to clipboard operation
jupyter-c-kernel copied to clipboard

Permission denied

Open YAGregor opened this issue 7 years ago • 3 comments

hi,I found this project just now and I was surprised that C program can run on jupyternotebook. But after I install jupyter-c-kernel by

sudo pip3 install jupyter-c-kernel
sudo install_c_kernel
jupyter notebook

I try to run a simple C program

#include <stdio.h>
int main(){
    printf("hello world");
    return 0;
}

there is no any output in jupyter notebook cell,and the jupyter shell output

Does not exist that file or directory
[IPKernelApp] WARNING | Unknown message type: 'comm_open'
[IPKernelApp] WARNING | Unknown message type: 'comm_open'
[IPKernelApp] ERROR | Exception in message handler:
Traceback (most recent call last):
  File "/home/rousci/anaconda3/lib/python3.6/site-packages/ipykernel/kernelbase.py", line 235, in dispatch_shell
    handler(stream, idents, msg)
  File "/home/rousci/anaconda3/lib/python3.6/site-packages/ipykernel/kernelbase.py", line 399, in execute_request
    user_expressions, allow_stdin)
  File "/home/rousci/.local/lib/python3.6/site-packages/jupyter_c_kernel/kernel.te
    p = self.create_jupyter_subprocess([self.master_path, binary_file.name] + ma
  File "/home/rousci/.local/lib/python3.6/site-packages/jupyter_c_kernel/kernel.upyter_subprocess
    lambda contents: self._write_to_stderr(contents.decode()))
  File "/home/rousci/.local/lib/python3.6/site-packages/jupyter_c_kernel/kernel.
    super().__init__(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, bufsiz
  File "/home/rousci/anaconda3/lib/python3.6/subprocess.py", line 707, in __init
    restore_signals, start_new_session)
  File "/home/rousci/anaconda3/lib/python3.6/subprocess.py", line 1326, in _exec
    raise child_exception_type(errno_num, err_msg)
PermissionError: [Errno 13] Permission denied

I've try to uninstall jupyter-c-kernel by sudo pip3 uninstall jupyter-c-kernel, but the C kernel still shows in the GUI interface

after I try to install jupyter-c-kernel again by

pip install jupyter-c-kernel --user
install-c-kernel --user
jupyter notebook

I got the same error. I do not know how to solve it, maybe I know too title about Jupyter notebook or Ipython anyway, thanks for your work.

YAGregor avatar Sep 16 '17 14:09 YAGregor

I just sovled it by copying the resources folder but I do not know why

YAGregor avatar Sep 17 '17 08:09 YAGregor

@ScienceYuan can you elaborate please how did you solve it?

Daniel-M avatar Nov 15 '17 14:11 Daniel-M

@Daniel-M I just copy the resource floder where the jupyter-c-kernel was installed (I use anacoda,so for me it is in /home/username/anacoda3/lib/python3.6/site-packages/jupyter_c_kernel) to its uppper floder(for me it's /home/username/anacoda3/lib/python3.6/site-packages/).

you may had sovled that.

YAGregor avatar Nov 19 '17 07:11 YAGregor