IPython keeps giving Kernel error

1,094 views
Skip to first unread message

Shubham Bhushan

unread,
Sep 30, 2015, 11:29:56 AM9/30/15
to julia-users
 My Julia kernel was working perfectly with Jupyter and Juno However it has suddenly stopped connecting with the ipython notebook. Any ideas as to why this might have happened along with possible solutions? Thanks.

Steven G. Johnson

unread,
Sep 30, 2015, 11:43:24 AM9/30/15
to julia-users
What happens when you open up the Julia command line ("REPL" ... i.e. double-click on the Julia program in Mac or Windows) and type

Pkg.update()
Pkg.build("IJulia")

If there is an error message in the second step, that should be a clue.  If not, relaunch `jupyter notebook` and try again.

Shubham Bhushan

unread,
Oct 1, 2015, 5:45:03 AM10/1/15
to julia-users
I tried both 
Pkg.update() and Pkg.build("IJulia")
Both worked without any glitches however the kernel still fails to start when I open jupyter

Steven G. Johnson

unread,
Oct 1, 2015, 8:06:21 AM10/1/15
to julia-users
See the "debugging" section of the IJulia readme. If you can't figure out what's wrong, file an IJulia issue on github. Include your versioninfo(true) output and any error messages printed in your terminal after enabling debugging output.

Note that your messages so far have not really been informative enough to provide you with much advice. "It doesn't work" or equivalents thereof aren't a useful description.

Shubham Bhushan

unread,
Oct 1, 2015, 9:55:46 AM10/1/15
to julia-users
I wish I could give you a more helpful message but quite literally, the Ipython notebook says Failed to restart kernel.

×
Dead kernel
The kernel has died, and the automatic restart has failed. It is possible the kernel cannot be restarted. If you are not able to restart the kernel, you will still be able to save the notebook, but running code will no longer work until the notebook is reopened.

this is the verbatim output

Steven G. Johnson

unread,
Oct 1, 2015, 2:23:55 PM10/1/15
to julia-users


On Thursday, October 1, 2015 at 9:55:46 AM UTC-4, Shubham Bhushan wrote:
I wish I could give you a more helpful message but quite literally, the Ipython notebook says Failed to restart kernel.

×
Dead kernel
The kernel has died, and the automatic restart has failed. It is possible the kernel cannot be restarted. If you are not able to restart the kernel, you will still be able to save the notebook, but running code will no longer work until the notebook is reopened.

this is the verbatim output


Basic information would be your OS, your Julia version, your Jupyter version, what Python distro you are using.   More information could be provided by reading the "debugging IJulia" instructions that I mentioned, which may provide additional error output. 

ron...@gmail.com

unread,
Oct 8, 2015, 12:46:43 AM10/8/15
to julia-users
I'm having the same problem.

Mac OS 10.11
Julia 0.3.11
Jupyter 4.0.6

Python 2.7.10


Set verbose-debug=true and stderr-capture=false as suggested at https://github.com/JuliaLang/IJulia.jl


Error dump follows:


##########################

$ jupyter-notebook moj-notes.ipynb 

[I 21:37:21.750 NotebookApp] Serving notebooks from local directory: /Users/ubi/work/study/julia

[I 21:37:21.750 NotebookApp] 0 active kernels 

[I 21:37:21.750 NotebookApp] The IPython Notebook is running at: http://localhost:8888/

[I 21:37:21.751 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

[I 21:37:24.244 NotebookApp] Kernel started: 8ed88591-0a25-4c1a-9d07-5ba953a4a853

ERROR: type: instantiate_type: expected TypeConstructor, got Function

 in anonymous at no file:236

 in include at /usr/local/Cellar/julia/0.3.11/lib/julia/sys.dylib

 in include_from_node1 at /usr/local/Cellar/julia/0.3.11/lib/julia/sys.dylib

 in reload_path at loading.jl:152

 in _require at loading.jl:67

 in require at loading.jl:51

 in include at /usr/local/Cellar/julia/0.3.11/lib/julia/sys.dylib

 in include_from_node1 at /usr/local/Cellar/julia/0.3.11/lib/julia/sys.dylib

 in include at /usr/local/Cellar/julia/0.3.11/lib/julia/sys.dylib

 in include_from_node1 at loading.jl:128

 in process_options at /usr/local/Cellar/julia/0.3.11/lib/julia/sys.dylib

 in _start at /usr/local/Cellar/julia/0.3.11/lib/julia/sys.dylib

while loading /Users/ubi/.julia/v0.3/ZMQ/src/ZMQ.jl, in expression starting on line 234

while loading /Users/ubi/.julia/v0.3/IJulia/src/IJulia.jl, in expression starting on line 13

while loading /Users/ubi/.julia/v0.3/IJulia/src/kernel.jl, in expression starting on line 4

[I 21:37:27.243 NotebookApp] KernelRestarter: restarting kernel (1/5)

##########################


Any suggestions?

David P. Sanders

unread,
Oct 8, 2015, 1:16:04 AM10/8/15
to julia-users
You could try with the latest Julia 0.4 release candidate. Have you tried deleting your whole .julia directory and reinstalling IJulia?

Tony Kelman

unread,
Oct 8, 2015, 1:16:35 AM10/8/15
to julia-users
What does Pkg.installed("ZMQ") say?

ron...@gmail.com

unread,
Oct 8, 2015, 1:31:17 AM10/8/15
to julia-users
Wow, you guys are fast to reply!

On Wednesday, October 7, 2015 at 10:16:35 PM UTC-7, Tony Kelman wrote:
What does Pkg.installed("ZMQ") say?

v"0.3.0"

FYI, I tried to update everything, e.g. 

$ brew update
$ brew upgrade
julia> Pkg.update()
julia> Pkg.build("IJulia")
$ pip list --outdated 
$ pip install -U <each outdated package>

etc.  Not sure why I sometimes need to do a Pkg.build() e.g. with IJulia.  Does ZMQ require a build() also?

 

ron...@gmail.com

unread,
Oct 8, 2015, 2:28:17 PM10/8/15
to julia-users
I'm still stuck on this.

On Wednesday, October 7, 2015 at 10:16:04 PM UTC-7, David P. Sanders wrote:
You could try with the latest Julia 0.4 release candidate. Have you tried deleting your whole .julia directory and reinstalling IJulia?

Not yet. If I remove ~/.ijulia/, would I need to Pkg.add() all the packages I have installed?:

julia> Pkg.installed()

Dict{ASCIIString,VersionNumber} with 25 entries:

  "Nettle"            => v"0.2.0"

  "REPLCompletions"   => v"0.0.3"

  "FixedPointNumbers" => v"0.0.12"

  "SHA"               => v"0.1.2"

  "Plotly"            => v"0.0.3+"

  "PyCall"            => v"0.8.1"

  "LaTeXStrings"      => v"0.1.5"

  "Docile"            => v"0.5.18"

  "WoodburyMatrices"  => v"0.1.2"

  "LibCURL"           => v"0.1.4"

  "Grid"              => v"0.3.11"

  "JSON"              => v"0.4.4"

  "ZMQ"               => v"0.3.0"

  "ColorTypes"        => v"0.1.7"

  "Compat"            => v"0.4.5+"

  "IJulia"            => v"0.1.16"

  "PyPlot"            => v"2.0.1"

  "Colors"            => v"0.5.4"

  "HTTPClient"        => v"0.1.5"

  "Dates"             => v"0.3.2"

  "BinDeps"           => v"0.3.15"

  "HttpCommon"        => v"0.1.2"

  "Reexport"          => v"0.0.3"

  "Homebrew"          => v"0.1.16"

  "URIParser"         => v"0.0.7" 

Tony Kelman

unread,
Oct 8, 2015, 9:12:00 PM10/8/15
to julia-users
You can make a copy of the REQUIRE file and put that in a clean new version of .julia, which will automatically install the same set of packages next time you run Pkg.update()

ron...@gmail.com

unread,
Oct 9, 2015, 12:15:15 AM10/9/15
to julia-users
Thanks for the suggestions, but they're not working for me at all.  :-(


On Thursday, October 8, 2015 at 6:12:00 PM UTC-7, Tony Kelman wrote:
You can make a copy of the REQUIRE file and put that in a clean new version of .julia, which will automatically install the same set of packages next time you run Pkg.update()

Tried it.  First error dump:

 julia> Pkg.update()

INFO: Updating METADATA...

ERROR: chdir METADATA: no such file or directory (ENOENT)

 in cd at /usr/local/Cellar/julia/0.3.11/lib/julia/sys.dylib (repeats 2 times)

 in update at /usr/local/Cellar/julia/0.3.11/lib/julia/sys.dylib

 in anonymous at pkg/dir.jl:28

 in cd at /usr/local/Cellar/julia/0.3.11/lib/julia/sys.dylib

 in __cd#229__ at /usr/local/Cellar/julia/0.3.11/lib/julia/sys.dylib

 in update at /usr/local/Cellar/julia/0.3.11/lib/julia/sys.dylib


Added an empty METADATA subdirectory.  Next error dump:


julia> Pkg.update()

INFO: Updating METADATA...

fatal: Not a git repository (or any of the parent directories): .git

ERROR: failed process: Process(`git rev-parse --symbolic-full-name --abbrev-ref HEAD`, ProcessExited(128)) [128]

 in error at /usr/local/Cellar/julia/0.3.11/lib/julia/sys.dylib

 in readbytes at /usr/local/Cellar/julia/0.3.11/lib/julia/sys.dylib

 in readchomp at pkg/git.jl:24

 in anonymous at pkg/entry.jl:238

 in cd at /usr/local/Cellar/julia/0.3.11/lib/julia/sys.dylib

 in update at /usr/local/Cellar/julia/0.3.11/lib/julia/sys.dylib

 in anonymous at pkg/dir.jl:28

 in cd at /usr/local/Cellar/julia/0.3.11/lib/julia/sys.dylib

 in __cd#229__ at /usr/local/Cellar/julia/0.3.11/lib/julia/sys.dylib

 in update at /usr/local/Cellar/julia/0.3.11/lib/julia/sys.dylib


Sigh.

ron...@gmail.com

unread,
Oct 9, 2015, 12:43:47 AM10/9/15
to julia-users
I got it working now.  The suggestion to start with an empty ~/.julia/ didn't work, but fortunately I just renamed .julia to .oldjulia and kept everything there. After removing the empty directory, I restored .oldjulia to .julia and then Pkg.update()found a whole slew of new versions of packages.  I'm dumfounded, but happy again with jupyter-notebook and the julia kernel.

Another oddity I noticed is that I have a sub-hierarchy of stuff under .julia/, namely

.julia/v0.3/
.julia/.julia/v0.3/

There are many duplicate files underneath these two levels.  Is this normal?

Thanks all for the suggestions!

to...@kelman.net

unread,
Oct 9, 2015, 2:49:53 AM10/9/15
to julia...@googlegroups.com

No, that's not normal. Did you first install julia when it was version 0.2?

ron...@gmail.com

unread,
Oct 9, 2015, 9:56:28 AM10/9/15
to julia-users
On Thursday, October 8, 2015 at 11:49:53 PM UTC-7, Tony Kelman wrote:

No, that's not normal. Did you first install julia when it was version 0.2?


Yes, I think so. I've been using Homebrew to keep Julia updated, from the staticfloat/julia tap. 

Tony Kelman

unread,
Oct 9, 2015, 10:06:09 AM10/9/15
to julia-users
I don't really know where a .julia/.julia would have come from, but you should be able to safely delete it.
Reply all
Reply to author
Forward
0 new messages