Kotlin / kotlin-jupyter

Kotlin kernel for Jupyter/IPython
Apache License 2.0
1.1k stars 106 forks source link

Cannot find kernel #268

Closed nattanyz closed 3 years ago

nattanyz commented 3 years ago

Hi, I am not able to use the Kotlin kernel after installing both it and Jupyter using pip3. I have also tried the fix-kernelspec-location script:

% python -m kotlin_kernel fix-kernelspec-location
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No module named kotlin_kernel
% python3 -m kotlin_kernel fix-kernelspec-location

To reproduce the error:

  1. I start a Jupyter session using jupyter lab.
  2. I am still only able to use the Python3 kernel, as shown in the screenshot below: Screenshot 2021-05-27 at 1 16 34 PM

Any help is appreciated! I'm fairly new to setting up Python environments and have gotten myself confused with Anaconda, virtual environments and the like before, so I'm opting to keep things simple using just pip3 for now.

Here's more explanation of my installation process: While installing Jupyter using pip3 install jupyter, I encountered the following error at the end:

ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/usr/local/etc/jupyter/nbconfig/notebook.d/widgetsnbextension.json'
Consider using the `--user` option or check the permissions.

Googling this error did not provide any hints. I then ran pip3 install jupyterlab. At this point, trying jupyter lab produced this error: 'ExtensionManager' object has no attribute '_extensions', which I surmise is linked to this issue: https://github.com/jupyterlab/jupyterlab/issues/10228 I tried the fix on that page, i.e. jupyter server extension disable nbclassic. Next, I uninstalled and reinstalled the Kotlin kernel using pip3 uninstall kotlin-jupyter-kernel followed by pip3 install kotlin-jupyter-kernel. Below is the output:

Collecting kotlin-jupyter-kernel
  Downloading kotlin_jupyter_kernel-0.10.0.40-py3-none-any.whl (70.5 MB)
     |████████████████████████████████| 70.5 MB 9.4 MB/s 
Installing collected packages: kotlin-jupyter-kernel
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/usr/local/share/jupyter/kernels/kotlin'
Consider using the `--user` option or check the permissions.

Thank you!

ileasile commented 3 years ago

Hello, @nattanyz!

As I see, you don't have enough permissions to install the package

Could not install packages due to an OSError: [Errno 13] Permission denied

Try --user option as PIP suggested:

pip3 install --user kotlin-jupyter-kernel==0.10.0.40

Then fix the location:

python -m kotlin_kernel fix-kernelspec-location

Another possible fix: try to install the package with sudo:

sudo pip3 install kotlin-jupyter-kernel==0.10.0.40
nattanyz commented 3 years ago

Hey, thanks and sorry for the late reply! Haven't been able to revisit this in a while.

sudo installing the package worked - thanks :)