davidbrochart / nbterm

Jupyter Notebooks in the terminal.
MIT License
756 stars 37 forks source link

Error at start #33

Closed aborruso closed 1 year ago

aborruso commented 3 years ago

Hi, when I run nbterm I have

Unhandled exception in event loop:
  File "/home/aborruso/.local/lib/python3.9/site-packages/kernel_driver/driver.py", line 96, in start
    self.kernel_process = await launch_kernel(
  File "/home/aborruso/.local/lib/python3.9/site-packages/kernel_driver/connect.py", line 73, in launch_kernel
    p = await asyncio.create_subprocess_exec(
  File "/usr/lib/python3.9/asyncio/subprocess.py", line 236, in create_subprocess_exec
    transport, protocol = await loop.subprocess_exec(
  File "/usr/lib/python3.9/asyncio/base_events.py", line 1661, in subprocess_exec
    transport = await self._make_subprocess_transport(
  File "/usr/lib/python3.9/asyncio/unix_events.py", line 197, in _make_subprocess_transport
    transp = _UnixSubprocessTransport(self, protocol, args, shell,
  File "/usr/lib/python3.9/asyncio/base_subprocess.py", line 36, in __init__
    self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
  File "/usr/lib/python3.9/asyncio/unix_events.py", line 789, in _start
    self._proc = subprocess.Popen(
  File "/usr/lib/python3.9/subprocess.py", line 947, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1819, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)

Exception [Errno 2] No such file or directory: 'python'

Thank you

davidbrochart commented 3 years ago

Hi @aborruso, maybe you don't have a kernel installed? If you want a Python kernel, you can either install ipykernel or xeus-python.

thor314 commented 1 year ago

@davidbrochart , having the same issue. Installed via pip install nbterm. I've installed both, just to check if it makes a difference:

~/py/play ❯ pip list  | rg "(kern|xeu)"                                                                                        18:03:23
ipykernel                6.19.4
kernel-driver            0.0.7
kernelstub               3.1.4
xeus-python              0.15.0
xeus-python-shell        0.5.0

when starting nbterm:

~/py/play ❯ nbterm play\ notebook.ipynb                                                                                        18:05:01

Unhandled exception in event loop:
  File "/home/thor/.local/lib/python3.10/site-packages/kernel_driver/driver.py", line 139, in start
    self.kernel_process = await launch_kernel(
  File "/home/thor/.local/lib/python3.10/site-packages/kernel_driver/connect.py", line 80, in launch_kernel
    p = await asyncio.create_subprocess_exec(
  File "/usr/lib/python3.10/asyncio/subprocess.py", line 218, in create_subprocess_exec
    transport, protocol = await loop.subprocess_exec(
  File "/usr/lib/python3.10/asyncio/base_events.py", line 1667, in subprocess_exec
    transport = await self._make_subprocess_transport(
  File "/usr/lib/python3.10/asyncio/unix_events.py", line 207, in _make_subprocess_transport
    transp = _UnixSubprocessTransport(self, protocol, args, shell,
  File "/usr/lib/python3.10/asyncio/base_subprocess.py", line 36, in __init__
    self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
  File "/usr/lib/python3.10/asyncio/unix_events.py", line 799, in _start
    self._proc = subprocess.Popen(
  File "/usr/lib/python3.10/subprocess.py", line 969, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)

Exception [Errno 2] No such file or directory: 'python'
davidbrochart commented 1 year ago

Can you post the output of which python?

aborruso commented 1 year ago

@aborruso I have reinstalled today in a new PC and I have the same error.

In my machine, the python app is python3 and not python.

aborruso commented 1 year ago

I have solved creating a link

sudo ln -s /usr/bin/python3 /usr/bin/python