Skip to content

Update kernel installation #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 101 additions & 2 deletions examples/Notebook/Multiple Languages, Frontends.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,105 @@
"about the notebook document: it just gets sent cells of code to execute when the\n",
"user runs them."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Install more languages\n",
"\n",
"The exact procedure to install a kernel for a different language will depend on the specificity of each language. \n",
"Though ther is a common set of step to follow.\n",
"\n",
" - Install the language stack you are interested in.\n",
" - Install the kernel for this language (often using given language package manager).\n",
" - Register the kernel globally with Jupyter. \n",
" \n",
"While usually a kernel is though as a specific language, a kernel may be:\n",
"\n",
" - A virtual environment (or equivalent)\n",
" - A set of configuration/environment variables.\n",
" - A physical location (for remote kernels)\n",
" \n",
"Installing multiple kernels does not automatically allow one notebook to use many languages at once, but this is also possible.\n",
"\n",
"A community maintained list of available kernel can be found on the [Jupyter Wiki](https://github.com/jupyter/jupyter/wiki/Jupyter-kernels). "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Install a second python kernel\n",
"\n",
"\n",
"Using conda:\n",
"\n",
"\n",
"```\n",
"$ conda create -n pycon-env python=3.6 --yes --quiet\n",
"$ source activate pycon-env\n",
"(pycon-env)$ conda install ipykernel --yes\n",
"(pycon-env)$ python -m ipykernel install --name pycon-kernel\n",
"Installed kernelspec pycon-kernel in /usr/local/share/jupyter/kernels/pycon-kernel\n",
"```\n",
"\n",
"Available options are `--user`, `--name <machine-readable-name>`, `--display-name <\"User Friendly Name\">`"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Install and R kernel\n",
"\n",
"\n",
"Again using conda, let's install the R stack and create an R kernel.\n",
"\n",
"In a shell:\n",
"```\n",
"$ conda install -c r r # install r form teh R channel\n",
"$ conda install -c r r-irkernel\n",
"$ r\n",
"> IRkernel::installspec()\n",
"```\n",
"\n",
"If you are not using conda you may need to replace by :\n",
"\n",
"```\n",
"$ R\n",
"> install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))\n",
"...\n",
"> devtools::install_github('IRkernel/IRkernel')\n",
"```\n",
"\n",
"You may want to install Rin the **same** environment as the previous Python Kernel if you wish to do R **and** python inthe same notebook. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### install more kernels\n",
"\n",
"Feel fre to experiment with other kernel, poke at the installed kernelspec folders. Use the following to list all the kernels and their locations:\n",
"\n",
"```\n",
"$ jupyter kernelspec list\n",
"Available kernels:\n",
" ir /home/jovyan/.local/share/jupyter/kernels/ir\n",
" julia-0.5 /opt/conda/share/jupyter/kernels/julia-0.5\n",
" python3 /opt/conda/share/jupyter/kernels/python3\n",
" python2 /usr/local/share/jupyter/kernels/python2\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The above process can take a long time, need to compile a few modules. You may want to try the `jupyter/datascience-notebook` Docker image which already have Python, Julia and R installed. Warning the Docker image is big (several GB) ! Please don't try to download it on Conference wifi. "
]
}
],
"metadata": {
Expand All @@ -114,9 +213,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.3"
"version": "3.6.0"
}
},
"nbformat": 4,
"nbformat_minor": 0
"nbformat_minor": 1
}
Loading