davidbrochart / nbterm

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

Nbterm asks for python while it should ask for python3 IMHO #17

Closed oricou closed 3 years ago

oricou commented 3 years ago

I removed python link on my computer so I have to run python2 or python3 to avoid mistake. Could you look for python3 instead of python?

Exception [Errno 13] Permission denied: 'python'

davidbrochart commented 3 years ago

Could you share more details, when does that happen?

oricou commented 3 years ago

Without any python link (so python is not a command):

% nbterm

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

Exception [Errno 2] No such file or directory: 'python' Press ENTER to continue...

oricou commented 3 years ago

The error message is different but it was what I had before I made the link and removed it!

oricou commented 3 years ago

I had a python directory in my ~/bin directory which is in the PATH. Whatever, the error is at the same time.

davidbrochart commented 3 years ago

This looks more like a kernel issue. For instance, the ipykernel kernelspec in my environment is at ~/mambaforge/envs/nbterm-dev/share/jupyter/kernels/python3/kernel.json:

{
 "argv": [
  "/home/david/mambaforge/envs/nbterm-dev/bin/python",
  "-m",
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ],
 "display_name": "Python 3",
 "language": "python"
}

And it will use my Python interpreter at /home/david/mambaforge/envs/nbterm-dev/bin/python. Can you locate your kernelspec and post its content?

oricou commented 3 years ago

In /usr/local/share/jupyter/kernels/python3/kernel.json:

{
 "argv": [
  "python",
  "-m",
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ],
 "display_name": "Python 3",
 "language": "python"
}

Replacing first python by python3 works. Thanks.