IJulia error syntax: undefined reference in AST

Suddenly when I try to start up IJulia and run any code in a Jupyter notebook or jupyter lab (e.g. just return the number 1), I get an error:

syntax: undefined reference in AST

 [1] top-level scope at In[1]:0
 [2] include_string(::Function, ::Module, ::String, ::String) at ./loading.jl:1091
 [3] execute_code(::String, ::String) at /home/mason/.julia/packages/IJulia/a1SNk/src/execute_request.jl:27
 [4] execute_request(::ZMQ.Socket, ::IJulia.Msg) at /home/mason/.julia/packages/IJulia/a1SNk/src/execute_request.jl:86
 [5] #invokelatest#1 at ./essentials.jl:710 [inlined]
 [6] invokelatest at ./essentials.jl:709 [inlined]
 [7] eventloop(::ZMQ.Socket) at /home/mason/.julia/packages/IJulia/a1SNk/src/eventloop.jl:8
 [8] (::IJulia.var"#15#18")() at ./task.jl:356

I am on a rolling release Linux distro (manjaro) so I suspect that a update to Jupyter or one of Jupyter’s dependencies broke this.

Does anyone have advice to help me diagnose this issue? I’d really appreciate the help. I tried updating IJulia, running build IJulia, deleting and reinstalling IJulia, etc.

Hm, I managed to uninstall Jupyter from my machine and then reinstalling IJulia.jl prompted me to install Jupyter via Conda.

Unfortunately, the error did not go away.

Upgraded to 1.5.3 this afternoon. Tried IJulia when I saw this post and had no problems.

Running 1.5.3 on a Mac with the latest OS.

Yeah, I got this error on 1.5.2. This is unrelated to the julia version. I have upgraded to 1.5.3 and that has also not fixed the issue.

Opened an issue: https://github.com/JuliaLang/IJulia.jl/issues/960

1 Like

This solved it for me:

  1. Close all Julia sessions
  2. Remove all content of ~/.julia/packages/IJulia/ and ~/.julia/compiled/v1.5/IJulia/
  3. In REPL of v1.5.3:
using Pkg
Pkg.add(Pkg.PackageSpec(;name="IJulia", version="1.21.3"))
  1. Launch Jupyter, it should work now.

That did it, thanks!