Kernel missing

92 views
Skip to first unread message

testb...@gmail.com

unread,
Apr 4, 2017, 9:46:56 AM4/4/17
to Project Jupyter
Hi,
Could anyone please provide some details on how to resolve the below issues?

I have Anaconda 2 and 3 installed. I have also JupyterHub and Jupyter notebook installed.

When I run jupyter kernelspec list command, I see the python2 and python3 kernel picked up from the below location.

python3     /anaconda3/lib/python3.5/site-packages/ipykernel/resources
python2     /usr/local/share/jupyter/kernels/python2


1. Could  anyone let me know why python2 is picked up from a different location instead of (/anaconda2/lib/python2.7/site-packages/ipykernel/resources)?

2. If python2 or python3 location is incorrect, how can I change them?


Thanks Much!

Thomas Kluyver

unread,
Apr 4, 2017, 10:00:02 AM4/4/17
to Project Jupyter
The answer here is substantially the same as the answer I just wrote to your other thread, but there's an extra detail. Jupyter will only pick up the site-packages location for a kernel installed in the same version of Python as Jupyter - in your case, that's the Python 3 kernel. So you need the kernelspec installed in a separate location for it to find the Python 2 kernel.

Thomas

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/219367c4-7996-4e5c-9fe0-1f9167157be0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

testb...@gmail.com

unread,
Apr 4, 2017, 10:14:36 AM4/4/17
to Project Jupyter
Thomas,
Thanks!
Could you please let me know what command(s) do I need to run to install the kernelspec in a separate location to find python2 kernel?

Also, could you let me know what the separate location would be ? If these details are in a document, could you please send me the link.

Thanks again! 


On Tuesday, April 4, 2017 at 9:00:02 AM UTC-5, takowl wrote:
The answer here is substantially the same as the answer I just wrote to your other thread, but there's an extra detail. Jupyter will only pick up the site-packages location for a kernel installed in the same version of Python as Jupyter - in your case, that's the Python 3 kernel. So you need the kernelspec installed in a separate location for it to find the Python 2 kernel.

Thomas
On 4 April 2017 at 14:46, <testb...@gmail.com> wrote:
Hi,
Could anyone please provide some details on how to resolve the below issues?

I have Anaconda 2 and 3 installed. I have also JupyterHub and Jupyter notebook installed.

When I run jupyter kernelspec list command, I see the python2 and python3 kernel picked up from the below location.

python3     /anaconda3/lib/python3.5/site-packages/ipykernel/resources
python2     /usr/local/share/jupyter/kernels/python2


1. Could  anyone let me know why python2 is picked up from a different location instead of (/anaconda2/lib/python2.7/site-packages/ipykernel/resources)?

2. If python2 or python3 location is incorrect, how can I change them?


Thanks Much!

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.

Thomas Kluyver

unread,
Apr 4, 2017, 10:40:20 AM4/4/17
to Project Jupyter
On 4 April 2017 at 15:14, <testb...@gmail.com> wrote:
Could you please let me know what command(s) do I need to run to install the kernelspec in a separate location to find python2 kernel?

In this case, you appear to already have it installed (or it wouldn't be listed). Information about installing the kernelspec for IPython is here:
http://ipython.readthedocs.io/en/stable/install/kernel_install.html

testb...@gmail.com

unread,
Apr 11, 2017, 3:31:05 PM4/11/17
to Project Jupyter
Thanks! The below kernel-install link helped.
When I ran the command - python2 -m pip install ipykernel, I got "Requirement already satisfied" message.
When I ran the below command, I got the below message.

python2 -m ipykernel install --user
Installed kernelspec python2 in /home/<userid>/.local/share/jupyter/kernels/python2

Can I copy from the above location to /app/anaconda2/lib/python3.5/site-packages/ipykernel/resources directory?

I want this kernel to be available to everyone. Appreciate your help!

Thomas Kluyver

unread,
Apr 12, 2017, 4:22:25 AM4/12/17
to Project Jupyter
On 11 April 2017 at 20:31, <testb...@gmail.com> wrote:
Can I copy from the above location to /app/anaconda2/lib/python3.5/site-packages/ipykernel/resources directory?

I want this kernel to be available to everyone. Appreciate your help!

You shouldn't need to copy things into site-packages. If you want to install the kernelspec to a systemwide location, remove the --user from the command (i.e. python -m ipykernel install). This should install in /usr/local/share/jupyter/kernels .

testb...@gmail.com

unread,
Apr 12, 2017, 6:13:24 AM4/12/17
to Project Jupyter

Thanks!
I ran the python -m ipykernel install and can now see both python2 and 3 under /usr/local.share/jupyter/kernels

My questions are
1. Do I need to delete the kernel from site-packages or leave them there 'as is'?
2. Since, now I have both python2 and python3 kernels, does the user need to set the path to the correct python path (using export PATH) before using the kernels? I don't think so. However , want to confirm.

Thanks again!

Thomas Kluyver

unread,
Apr 12, 2017, 9:29:40 AM4/12/17
to Project Jupyter
On 12 April 2017 at 11:13, <testb...@gmail.com> wrote:
1. Do I need to delete the kernel from site-packages or leave them there 'as is'?

I think your site-packages now contains two different things:
- The ipykernel Python package which contains the code to run the kernel. Don't delete this!
- A kernelspec (kernel.json and maybe associated files) that you tried to place there. This isn't needed; it shouldn't cause any problems for Jupyter, but it might one day cause you or someone else some confusion.
 
2. Since, now I have both python2 and python3 kernels, does the user need to set the path to the correct python path (using export PATH) before using the kernels? I don't think so. However , want to confirm.

No, it shouldn't be necessary. The kernel.json files should specify a full path to the Python interpreter they use.

Thomas
Reply all
Reply to author
Forward
0 new messages