michael
michael

Reputation: 391

Installing R kernel with conda creates an unwanted addtional python kernel in Jupyter

I created an R kernel to use in a Jupyter notebook with:

conda create -n myrenv r-essentials -c r

And when running Jupyter, in the menu to create a new notebook, i can see the choice of my new kernel new --> R [conda env:myrenv] but I also have the choice (among others) of new --> Python [conda env:myrenv].

How can I remove the latter environment from the list? I do not even know why python would be in my R environment.

Additional info:

conda 4.5.11

Upvotes: 0

Views: 176

Answers (1)

Eric C.
Eric C.

Reputation: 3368

r-essentials comes with python as well as the jupyter_client and the ipykernel packages which enables your jupyter to propose this R and thus the python installed as kernels in a notebook. ipykernel is mandatory for the jupyter to propose the R as a kernel and python is a dependency to ipykernel so...

I don't think you can remove python from the list of the kernels proposed. If you remove python from the conda environment, it also removes the ipykernel and the jupyter_client packages. All you can do is ignore it.

EDIT: found more infos

After looking into this since I wanted to do the same thing, it seems jupyter has a nice built-in program to do this:
Run
jupyter-kernelspec list
to list all available kernels. Then you can remove one with jupyter-kernelspec remove <kernel_to_remove>
if you want to remove the kernel.
HOWEVER, it seems that you CANNOT remove the python3 kernel. Even though I ran:
jupyter-kernelspec remove python3
python3 still appears in the list and is still an available kernel in the notebook...

Upvotes: 2

Related Questions