Unable to create a Julia file using Jupyter Notebook in Chrome browser - julia

I am trying to write Julia using Jupyter Notebook in Google Chrome browser but when I click on New, I do not get the option of creating a new Julia file (shown in the screenshot). I have already added the package- IJulia. What am I missing?

I've seen this before. Doing a Pkg.build("IJulia") and then restart Jupyter fixed it for me.
EDIT: corrected capitalisation

Related

Jupyter notebook autocomplete unavailable when using new environment

I have recently created a separate environment with conda. In this new environment, when I open jupyter notebook, clicking Tab to show autocomplete or suggestion doesn't work at all. There seem to be no obvious way to enable it.
using this line in your jupyter notebook help.
%config Completer.use_jedi = False

Table of Contents disappeared in Jupyter Notebook

Currently, a jupyter notebook does not show the lateral table of contents. All the other notebooks do.
In fact, for that notebook under menu->edit the nbextensions config disappeared, so, it looks like that notebook does not load the extension.
My jupyter version is 4.4.0.
How to fix that notebook?
I found the solution to this problem. All those advises like "close and then re-open", "clean output of the notebook" or "re-install extensions" won't work. The problem is in the javascript load timeouts.
In firefox press F12 and press on the red icon in the top right corner - you will see that you have an error
Load timeout for modules:
custom/custom,nbextensions/nbextensions_configurator/config_menu/main,
bla-bla-bla...
How to solve:
close the notebook in jupyter, open your ipynb file in any text editor, go to the end of it - you will find "metadata" section. Add the line
"setTimeout": 120
create a file ~/.jupyter/custom/custom.js if you don't have it (I have Linux, where it is in Windows - I have no idea, google for it) and put this contents into this file:
window.requirejs.config({
waitseconds: 90, // default is 30s
});
This page describes the problem in detail:
https://github.com/ipython-contrib/jupyter_contrib_nbextensions/issues/1195
In my case, disabling my ad-blocker brought the table of contents back.
Apparently, all it needs is to shutdown the notebook. After restarting it, all works fine. I suppose that problem happens when the notebook has been closed wrongly without the proper "close and halt" procedure.
My solution in these cases is, make a copy (File <Make a Copy), delete the original notebook and rename the copy (File <Rename)
For me it seems that one of the following steps worked:
Update all packages and jupyter notebook to the latest version using conda
Uninstall then install again the nbextensions configurator
Reboot the computer
For me the reason was 22 emojis in the headers, deleting 5 of them was enough for firefox to get toc back with no reloading and kernel operations.
I have the problem with Jupyter notebook version 6.1.4. After installing nbextensions and enabling extension "Table of Contents (2)" (as "toc" and "toc2" don't work), I cannot obtain the TOC of an a notebook (2.8 MB), while new notebooks have a table of contents.
Reloading, reopening, restarting jupyter does not help, even after a long wait (> 15 min).
I have tried with browsers Mozilla Firefox version 83 and Chromium version 87.
However, a workaround is to create a new notebook (with TOC), then copy all cells from old notebook to new notebook. In order to do this, this might be useful:
how to copy cells from notebook to notebook and
how to select all cells.
Actually I could not copy all cells at once, I had to do three partial copies.
Alas, my method is not only painful but also ineffective in the long term, as the TOC disappeared again.
Restarting the computer worked or did not work.
Opening a small notebook with a table of content and reloading the big notebook worked or did not work.
The problem concerns all Nbextensions, they are just not active for the big notebook. A Javascript console is shown in Google Chrome with Control Shift J.
Error: Load timeout for modules:
nbextensions/nbextensions_configurator/config_menu/main,nbextensions/init_cell/main,nbextensions/spellchecker/main,nbextensions/toc2/main,nbextensions/jupyter-js-widgets/extension

Opening a specific Julia notebook (via IJulia) in the REPL

the Julia (i'm using 0.6.2) REPL makes it possible to do some work and then execute
julia> using IJulia
julia> notebook(dir=pwd(), detached=true)
which nicely launches jupyter in the directory specified by dir.
is it possible from the REPL to include a specific notebook to open ?
This worked for me recently (julia v 1.5.1, macOS 10.14):
using IJulia
notebook(dir="/path/to/directory/with/my/notebook",detached=true)
One thing I noticed is starting jupyter in the background, julia doesn't give you a link to where to open the notebook in the browser.
I was able to open http://localhost:8888/ in my browser to find the notebook, although I thought there was a URL token needed. This link in the browser also worked:
file:///$HOME/Library/Jupyter/runtime/nbserver-12912-open.html
I got this from the REPL documentation:
?notebook
#search: notebook
# notebook(; dir=homedir(), detached=false)
# ..etc
this kinda works (but feels like a hack):
julia> ;jupyter notebook someJuliaNotebook.ipynb 2>/dev/null &
which produces a relatively clutter free terminal window i can keep using.

Jupyter Notebooks Hang in Browser on Windows 10

I just installed Miniconda and the R Essentials bundle on my Windows 10 machine, following the instructions given here. Everything went swimmingly until I opened up an Anaconda command prompt and entered jupyter notebook and got an error. I then used ipython notebook which worked, so okay, no problem there.
However, after creating a new folder and trying to create a new R notebook within that folder, my Jupyter tabs started to hang. Whenever I try to do something, whether it is rename the notebook, run a block of code, basically anything, all of the Jupyter tabs sit there loading endlessly saying "Waiting for localhost..."
I try stopping the server and restarting it, but every time I try to do anything I get the same result. I also tried changing the port and running the command prompt as administrator--same result. I am using Chrome, which shouldn't be an issue.
Any ideas? I was really excited about using a Jupyter notebook to keep track of my analyses in R, but if I can't even get it to function out of the box I'll have to find a better solution.

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

Resources