Last active
March 11, 2016 04:25
-
-
Save ruxi/fc743676a3752ae14959 to your computer and use it in GitHub Desktop.
nbextension/NBextension.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"run_control": { | |
"read_only": false | |
} | |
}, | |
"source": [ | |
"**Intent**: view currently installed nbextensions and toggle off\n", | |
"\n", | |
"gist: https://gist.github.com/ruxi/fc743676a3752ae14959" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# How to install NBExtensions GUI for jupyter notebook 4.1" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"source: https://github.com/ipython-contrib/IPython-notebook-extensions" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 13, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"The version_information extension is already loaded. To reload it, use:\n", | |
" %reload_ext version_information\n" | |
] | |
}, | |
{ | |
"data": { | |
"application/json": { | |
"Software versions": [ | |
{ | |
"module": "Python", | |
"version": "3.5.1 64bit [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]" | |
}, | |
{ | |
"module": "IPython", | |
"version": "4.1.1" | |
}, | |
{ | |
"module": "OS", | |
"version": "Linux 3.16.0 33 generic x86_64 with debian jessie sid" | |
} | |
] | |
}, | |
"text/html": [ | |
"<table><tr><th>Software</th><th>Version</th></tr><tr><td>Python</td><td>3.5.1 64bit [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]</td></tr><tr><td>IPython</td><td>4.1.1</td></tr><tr><td>OS</td><td>Linux 3.16.0 33 generic x86_64 with debian jessie sid</td></tr><tr><td colspan='2'>Tue Mar 08 15:22:16 2016 CST</td></tr></table>" | |
], | |
"text/latex": [ | |
"\\begin{tabular}{|l|l|}\\hline\n", | |
"{\\bf Software} & {\\bf Version} \\\\ \\hline\\hline\n", | |
"Python & 3.5.1 64bit [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] \\\\ \\hline\n", | |
"IPython & 4.1.1 \\\\ \\hline\n", | |
"OS & Linux 3.16.0 33 generic x86\\_64 with debian jessie sid \\\\ \\hline\n", | |
"\\hline \\multicolumn{2}{|l|}{Tue Mar 08 15:22:16 2016 CST} \\\\ \\hline\n", | |
"\\end{tabular}\n" | |
], | |
"text/plain": [ | |
"Software versions\n", | |
"Python 3.5.1 64bit [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]\n", | |
"IPython 4.1.1\n", | |
"OS Linux 3.16.0 33 generic x86_64 with debian jessie sid\n", | |
"Tue Mar 08 15:22:16 2016 CST" | |
] | |
}, | |
"execution_count": 13, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"%load_ext version_information\n", | |
"%version_information " | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Get rid of lingering configs [... WIP]" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"View contents of local and global jupyter notebook directory" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"collapsed": false | |
}, | |
"source": [ | |
"\n", | |
"\n", | |
"```python\n", | |
"from __future__ import print_function\n", | |
"from jupyter_core.paths import jupyter_data_dir, jupyter_path\n", | |
"import os.path\n", | |
"print('local', os.listdir(jupyter_data_dir()))\n", | |
"print('global', [os.listdir(path) for path in jupyter_path() if os.path.isdir(path)])\n", | |
"```" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"list directory\n", | |
"\n", | |
"```python\n", | |
"\n", | |
"print(jupyter_data_dir())\n", | |
"print(jupyter_path())\n", | |
"\n", | |
"```" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# To install properly" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"```python\n", | |
"pip install https://github.com/ipython-contrib/IPython-notebook-extensions/archive/master.zip --user\n", | |
"```" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Navigate to [/nbextensions](/nbextensions) and toggle ON/OFF desired" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## troubleshooting\n", | |
"\n", | |
"- https://github.com/ipython-contrib/IPython-notebook-extensions/wiki/config-extension" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Data directory:" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 22, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"local ['notebook_secret', 'nbextensions', 'extensions', 'nbsignatures.db', 'templates']\n", | |
"global [['notebook_secret', 'nbextensions', 'extensions', 'nbsignatures.db', 'templates']]\n" | |
] | |
} | |
], | |
"source": [ | |
"# make sure nbextension, extensions, templates exist\n", | |
"\n", | |
"from __future__ import print_function\n", | |
"from jupyter_core.paths import jupyter_data_dir, jupyter_path\n", | |
"import os.path\n", | |
"print('local', os.listdir(jupyter_data_dir()))\n", | |
"print('global', [os.listdir(path) for path in jupyter_path() if os.path.isdir(path)])" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# version control" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 24, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Overwriting .gitignore\n" | |
] | |
} | |
], | |
"source": [ | |
"%%writefile .gitignore\n", | |
"ipynb_checkpoints*" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"%%bash \n", | |
"git add --all :/\n", | |
"git commit -a -m 'save gist'\n", | |
"git push origin master" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "IPython (Python 3)", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.5.1" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment