iPython with Django : CommandError: No notebook (Python) kernel specs found

By : V Patil
Source: Stackoverflow.com
Question!

I'm new to jupyter/ipython and django. I have Django 1.9.5 installed on Ubuntu 16.04 and my application is running fine. I want to configure iPython(version 5.1.0) to be used with my Django application. Basically trying to call the iPython notebook (browser) from django which later can be used extensively in the application through a user interface.

When I try to run the command below

$./manage.py shell_plus --notebook

I get an error:

[W 13:46:39.247 NotebookApp] Unrecognized JSON config file version, assuming version 1
[I 13:46:41.082 NotebookApp] [nb_conda_kernels] enabled, 2 kernels found
[I 13:46:41.114 NotebookApp] Writing notebook server cookie secret to /run/user/1000/jupyter/notebook_cookie_secret
[I 13:46:41.399 NotebookApp] ✓ nbpresent HTML export ENABLED
[W 13:46:41.399 NotebookApp] ✗ nbpresent PDF export DISABLED: No module named nbbrowserpdf.exporters.pdf
[I 13:46:41.409 NotebookApp] [nb_conda] enabled
[I 13:46:41.507 NotebookApp] [nb_anacondacloud] enabled
**CommandError: No notebook (Python) kernel specs found**

To resolve this I tried: ipython2 kernelspec install-self --user

Under home directory .local/share/jupyter/kernels folder there is a kernel.json file

I'm not sure why I'm still getting the same error. Any suggestion will be very helpful in resolving this issue. Thank you.

To achieve launching iPython notebook from Django I tried the following:

  1. Installed the django-extensions: pip install django-extensions
  2. In django settings.py file added the line django_extensions to INSTALLED_APPS
  3. Ran ipython profile create and uncommented this line : c.InteractiveShellApp.extensions = ['django_notebook']
By : V Patil


Answers

I had to remove the Jupyter Notebook extensions which resolved the issue:

$conda remove nb_conda

$ python manage.py shell_plus --notebook
[I 09:09:19.586 NotebookApp] Writing notebook server cookie secret to    /run/user/1000/jupyter/notebook_cookie_secret
[I 09:09:19.831 NotebookApp] Serving notebooks from local directory: /home/venkateshpatil1/dir/dir1/SC
[I 09:09:19.832 NotebookApp] 0 active kernels
[I 09:09:19.832 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
[I 09:09:19.833 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
By : V Patil


This video can help you solving your question :)
By: admin