Nteract not opening Julia Academy notebooks?

I’m just getting started with Julia and am trying to go through some of the notebooks associated with the Julia Academy courses. I have nteract installed and working, and I’ve downloaded a few of the starter notebooks from Github. However, every time I try to open one of the Julia Academy notebooks, I get this error message:

“Fetch content failed
SyntaxError: Unexpected token < in JSON at position 6”

This doesn’t happen with the example notebooks that nteract provides.

This is on a laptop running a current version of Kubuntu Linux.

Any helpful ideas out there?

You’re going to need to give more information. I’m on MacOS BigSur 11.2.3. I have nteract 0.28.0 and I downloaded and viewed without any problem the following notebook from Julia Academy:

https://raw.githubusercontent.com/JuliaAcademy/JuliaTutorials/main/introductory-tutorials/intro-to-julia/Working%20with%20matrices.ipynb

However, to run the notebooks you need Julia 1.0. Or perhaps you can compile the notebooks yourself and thus be able to run them on a more recent version.

Edit: So here’s what I did. Open the file above (extension ipynb) into any editor and change the fields to your version of Julia. In my case, 1.6.1. These are near the top of the file:

 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Julia 1.6.1",
   "language": "julia",
   "name": "julia-1.6"
  },
  "language_info": {
   "file_extension": ".jl",
   "mimetype": "application/julia",
   "name": "julia",
   "version": "1.6.1"
  },

After that I was able to run the notebooks (I could view them even without doing that).

Thank you ptoche. I tried using the pattern you provided, but with my version of Julia, 1.4.1. Now I just get a different error message:

“Launch kernel failed
A kernel named julia-1.4 does not appear to be available. Try installing the julia-1.4 kernelspec or selecting a different kernel.”

I thought that by installing IJulia I had installed the kernelspec. Anyway, as a non-programmer but with some experience using other languages, I’m finding getting set up to use IPython notebooks just to start learning Julia to be time-consuming and frustrating. I’ve backed off and switched to Pluto. I’m working through the Julia documentation using Pluto as a sort of scratchpad to try things out and that’s serving my purpose. Perhaps Pluto isn’t yet as evolved a system as IPython, but installing it was frustration-free and it worked out of the box. Unfortunately the switch to Pluto means that the Julia Academy notebooks aren’t useful to me but so be it.

Anyway, thanks for trying to help.

Sometimes Nteract is picky about the installed kernels. Maybe this helps:

  1. in the Julia REPL
using IJulia
IJulia.kerneldir()
  1. go to the folder indicated by (1) and delete any kernels except the one you want to use.
1 Like

Why are you using Julia 1.4? There is pretty much no conceivable scenario where in which a new user is better off using anything else but the latest stable release, which is currently 1.6.1

1 Like

I’m using 1.4 because I’m working in an unfamiliar environment, Kubuntu Linux, and for me the easiest way to install software for this setup is to get it from the Ubuntu repository. 1.4 is what Ubuntu has in the repository, apparently.

I’m not the level of Linux user with the skill or inclination to download the latest code and compile it on my machine.

I expect that if I get comfortable enough with Julia to start using it for a real task, I’ll install the latest version on a Windows machine. Windows is what I use for work and it’s a more familiar environment for me. This Linux machine is just a play machine where I fool around trying new things for fun. That’s why Linux is on it. In effect I’m learning about the operating system and Julia at the same time, so it isn’t exactly a smooth progression.

1 Like

Take a look at the Linux installation instructions here: Platform Specific Instructions for Official Binaries

As you can see, they state that it is “strongly recommended” that the official binaries from the Julia website are used. Note that this does not mean building from source, instead the installation is simply downloading a zip file and extracting it in a folder of your choice (and, if desired, adding the path of the Julia executable to your PATH).

2 Likes