Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No module named ipykernel_launcher

I'm trying to register a pyenv-virtual env as a jupiter lab kernel on MacOs. I have this working on ubuntu but I'm running into issues on my MacBook.

I followed the instructions here which creates the following kernel spec file.

{
"argv": [
"/Users/david/.pyenv/versions/python36-tf2/bin/python",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"display_name": "Python (3.6.8 TF2.0)",
"language": "python"
}

I tested by running Users/david/.pyenv/versions/python36-tf2/bin/python -m ipykernel_launcher and it works fine.

But when I run jupiter lab (system python) then try and use the new kernel it aborts with log messages

/Users/david/.pyenv/versions/python36-tf20/bin/python: No module named ipykernel_launcher

Any ideas how to fix, the pyenv definitely can run ipykernel_launcher?

like image 694
David Waterworth Avatar asked Aug 09 '19 02:08

David Waterworth


Video Answer


1 Answers

The error is due to the unavailability of the module named ipykernel_launcher. (reference)

Try this, this should work.

pip uninstall ipykernel # this may or may not be installed.
pip install ipykernel
like image 168
Mohith7548 Avatar answered Sep 16 '22 21:09

Mohith7548