Installing iPython Notebook - opening a $HOME file from editor - jupyter-notebook

I am attempting to install ipython notebook based on some instructions. However, while I tried to execute this 'In your favorite editor, open the file $HOME/.ipython/profile_default/ipython_notebook_config.py', I can't really open a file from TextWrangler. I am not familiar with this. Could anyone help me out there? Thank you very much!!

maybe it's not there? you can create it first, in Mac's terminal
touch $HOME/.ipython/profile_default/ipython_notebook_config.py
and then open it in TextWranggler
open -a /Applications/TextWrangler.app $HOME/.ipython/profile_default/ipython_notebook_config.py

Related

How do I access a .ipynb file? Do I neeed to download jupyter notebook in order to do this?

I'm doing the SQL course on coursera
Yes, you can install Jupyter Notebook as a library for python.
But also you can try open and run your file, for example, in Google Collab.

Creating Folder Failed on jupyter notebook

When I click "New" to create text file,folder, and python3 file on jupyter notebook, it shows that "Creating File Failed" and "An error occurred while creating a new file". Could you please give me some advice about how to solve this problem ? The screenshot is attached. Thank you very much !
Some details: I use pip install jupyter to install jupyter notebook in Linux environment. You can see from the attached screenshot that there is a new icon near to the upload icon on the upper right, then I click the black upside-down triangle on the new icon, then I choose folder. This is the process in which I try to create a new folder on jupyter notebook.
Use the --user tag with pip
The reason you cannot create a folder is because you do not have permission. This could be that you are not a on the sudo list or that you are not the owner of the folder where you are trying to create a new folder.
You can potentially avoid these problems by removing your jupyter install and re-installing with the '--user' option. Be sure that you have configured a non root user with sudo privileges and that you are logged in as that user. Try the following:
pip uninstall jupyter
pip install jupyter --user
Run notebook as usual:
jupyter notebook
One more thing, be sure that you are trying to create a folder in your home directory. If you are user "Bob", make sure you are creating the folder in /home/bob/ You are the owner of this directory and should be able to modify it as you wish.
Further reading:
link1
link2
I have found reasons that I cannot create new folder/file on jupyter notebook. Reason is that I directly open jupyter notebook in the anaconda3 environment, that's incorrect! Intuitive description is that I should switch from /home/${USER}/anaconda3 to /home/${USER}/anaconda3/bin, because when I use whereis jupyter, I find that jupyter is under /~/bin directory. So, I have a try and succeed !

Open multiple jupyter notebook with different extension config

I share a linux server user with my teammate, and we used the same jupyter notebook server together.
However recently I found some interesting plugins, so I created a new jupyter notebook directory ~/.my_jupyter, which is a copy of origin ~/.jupyter, and open jupyter notebook with config=/path/to/.my_jupyter/my_config.json then install some plugin by jupyter_contrib_nbextensions.
But when I enable a plugin in my jupyter, the other jupyter enable that plugin too. I found that new jupyter still reference the plugin status by origin .jupyter/nbconfig.
I am looking for a way to change nbconfig path just in my jupyter, hope someone can help me figure it out.
Thanks
Finally figure it out.
Create new tmux session and do following line in terminal:
export JUPYTER_CONFIG_DIR=/path/to/.my_jupyter
which .my_jupyter is configure path of your jupyter like origin ~/.jupyer.

Kernel loading forever in jupyter notebook

I'm using OSX Yosemite.
I've update ipython via conda and turns out notebook also has updated version, which I'm very excited to try this.The notebook has been converted into jupyter.
I'm using python 2.X, and already have existing .ipynb files. When I open it, new window appears but there's blank and nothing. I can create first cell there, but I already have my notebook. And the kernel also loading forever. There isn't any error log in the console. What do I have to do? Please help!
Nevermind, this solve the problem https://github.com/ipython/ipython/issues/5746
I'm using ccp notebook extension, and as Ian Hawke mentioned in the thread, remove the call to the extention at profile/static/custom/custom.js

What happened to the TOC extension for ipython notebook?

I'm trying to install the great table of contents extension in a new computer. but I cant find it anymore. the only page I do find does not explain how to install the extension on windows.
So.. How can I install it, and why is it not a part of the official Ipython notebook? I simply can't understand how people are getting along without it.
I've installed toc nbextension successfully with Jupyter 4 (ie. ipython notebook 4) recently.
In fact installing extension is easier than before :)
I post my solution here, may it help.
## download
mkdir toc
cd toc
wget https://raw.githubusercontent.com/minrk/ipython_extensions/master/nbextensions/toc.js
wget https://raw.githubusercontent.com/minrk/ipython_extensions/master/nbextensions/toc.css
## install and enable
cd ..
jupyter-nbextension install --user toc
jupyter-nbextension enable toc/toc
A bit more explain:
install will copy toc to ~/.local/share/jupyter/nbextensions/
enable will modify ~/.jupyter/nbconfig/notebook.json.
You can check these two place to see what happened.
Note: we use enable toc/toc here is because toc.js is in ~/.local/share/jupyter/nbextensions/toc/.
If you put toc.js and toc.css directly in ~/.local/share/jupyter/nbextensions/ then you should use enable toc here.
Edit
Sorry, I didn't notice the orginal problem is on windows. I'm not sure if it's same for windows jupyter, any report is welcome.
Update
Now the toc nbextension has been added into this project which provide a collection of kinds of nbextensions. It's very easy to install and manage, worth to try!
I cannot tell you specific Windows advice, but think the key points should be platform independent:
Create a profile (either a default profile or a named one - you'll probably want default to start).
Locate where the profile is.
Add the custom.js file into the profile.
Edit the custom.js file to point to the notebook extension code.
In a bit more detail, setting up a profile is covered in detail here but for a default profile just go to the command line and enter
ipython profile
Next, locate where your profile is stored by typing at the command line
ipython locate
Call that <profile_dir>.
The rest follows the (Windows equivalent of!) the instructions on the link you have: underneath <profile_dir> navigate to (creating any directories that do not already exist)
<profile_dir>/static/custom/
and add the custom.js file as shown. Then edit the first line, where it has "nbextensions/toc" to point to the location where you have placed the toc.js file you have downloaded. This location is relative to the <profile_dir>; for me I have
<profile_dir>/static/custom/custom.js
<profile_dir>/static/custom/nbextensions/toc.js
<profile_dir>/static/custom/nbextensions/toc.css
and the first line of custom.js reads
require(["/static/custom/nbextensions/toc.js"], function (toc) {
Finally, note that this is with version 1.1.0 of the notebook - if you're using an earlier version I strongly suggest you upgrade before trying this.
You'll also find the official installation instructions at:
https://github.com/minrk/ipython_extensions
These instructions include curl commands for retrieving the toc.js and toc.css files from GitHub, which worked fine for me in a bash shell on linux Mint.
For Windows 7, I used a Git Shell (see http://msysgit.github.io/) to execute the curl commands
This IPython Notebook semi-automatically generates the files for minrk's table of contents in Windows. It does not use the 'curl'-commands or links, but writes the *.js and *.css files directly into your IPython Notebook-profile-directory.
There is a section in the notebook called 'What you need to do' - follow it and have a nice floating table of contents : )
Here is an html version which already shows it:
http://htmlpreview.github.io/?https://github.com/ahambi/140824-TOC/blob/master/A%20floating%20table%20of%20contents.htm

Resources