Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for IPython 4.0 #340

Closed
pazzo83 opened this issue Aug 19, 2015 · 15 comments
Closed

Support for IPython 4.0 #340

pazzo83 opened this issue Aug 19, 2015 · 15 comments

Comments

@pazzo83
Copy link

pazzo83 commented Aug 19, 2015

I recently installed version 4.0 of IPython, where a full switch to Jupyter for the notebook app was made. Consequently, any of the notebook profiles (like julia) that were installed are not recognized now. Do you have any suggestions as to how I can get IJulia to work with IPython 4.0/Jupyter?

Thanks!

@yuyichao
Copy link
Contributor

Have you tried to reinstall IJulia? I'm under the impression that we've already dropped the support for ipython profile and switched fully to use the kernel spec on the master.

@pazzo83
Copy link
Author

pazzo83 commented Aug 19, 2015

Hmm, I just installed it earlier, I can try to remove and install again. I noticed I got it to work when I change the command being run in the notebook function in IJulia.jl to: run(jupyter notebook)

Of course, I first had to move over the config settings from the profile_julia folder in .ipython to jupyter_notebook_config.py in .jupyter.

@stevengj
Copy link
Member

Just do Pkg.checkout("IJulia") to get the version that uses the Jupyter protocol exclusively. (This gets the latest git version of IJulia, which hasn't been "tagged" as an official IJulia release yet.)

I should probably go ahead an pull the trigger on tagging this, so that you don't need master. I've been using it for a while and it seems quite stable, and I think most people have IPython 3 these days.

(I'm mainly worried about Ubuntu users, since the latest Ubuntu is still on IPython 2.x.)

@stevengj
Copy link
Member

See #325

@pazzo83
Copy link
Author

pazzo83 commented Aug 19, 2015

Using the master branch (via Pkg.checkout) didn't seem to work. When I initialize IJulia (running "using IJulia"), it outputs a warning saying:
Warning: error initializing module IJulia: Base.MethodError(f=srand, args=(Base.Random.MersenneTwister(state=Base.dSFMT.DSFMT_state(val=Array{Int32, 1} [lots of random numbers]))))

That said, I am able to call "notebook()", and this starts IPython notebook. However, using version 4.0, it does not seem to read any of the kernels (including the Julia one) from .ipython/kernels. The only one that appears is for my version of Python.

Any ideas?

Thanks!

Edit: strangly enough, when I set the port (running ipython notebook --port=8998) to 8998 if I run from teh command line, the Julia kernel shows up in the drop down (upper right of the ipython page). I'm re-installing ipython right now to see if perhaps there is an issue there.

@stevengj
Copy link
Member

What is the output of Pkg.build("IJulia")?

@pazzo83
Copy link
Author

pazzo83 commented Aug 19, 2015

Here is the output:

julia> Pkg.build("IJulia")
INFO: Building WinRPM
INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win3
2/openSUSE_13.1/repodata/repomd.xml
INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win6
4/openSUSE_13.1/repodata/repomd.xml
INFO: Building Nettle
INFO: Updating WinRPM package list
INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win3
2/openSUSE_13.1/repodata/repomd.xml
INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win6
4/openSUSE_13.1/repodata/repomd.xml
INFO: Building ZMQ
INFO: Building IJulia
Found IPython version 4.0.0 ... ok.
Writing IJulia kernelspec to C:\Users{user_id}.ipython\kernels\julia-0.3\kernel.
json ...
(Existing logo-32x32.png file untouched.)
(Existing logo-64x64.png file untouched.)

Note, this is a Win 7 machine.

Thanks!

@stevengj
Copy link
Member

And after running that, the Julia kernel still does not show up in ipython notebook?

@pazzo83
Copy link
Author

pazzo83 commented Aug 20, 2015

Only if I add this line to the jupyter_notebook_config.py:
c.NotebookApp.port = 8998

However, I still get the Method errors from Julia, as it is complaining about the srand method in init in IJulia.jl. So when I call notebook, and then attempt to open a notebook using Julia, attempts to reach the kernel time out and I see additional Method errors like I see when I initialize IJulia (calling "using IJulia").

@stevengj
Copy link
Member

@pazzo83, the old port for IJulia was 8998 (to be distinct from IPython), so you're probably just going to the wrong URL out of habit in your browser. The default port for Jupyter is 8888, so you should be going to localhost:8888. (Running ipython notebook should automatically open this URL in your browser.)

Regarding the method errors, it could be that the latest IJulia master inadvertently depends on Julia 0.4; I'll check it out right now and fix it soon if so.

@pazzo83
Copy link
Author

pazzo83 commented Aug 20, 2015

Understood, if I remove that override (for the port) and have it default to 8888, then only "Python" shows up as an available notebook, and not "Julia". Quite strange, could be an issue on my end.

@stevengj
Copy link
Member

@pazzo83, maybe you are running another IPython/Jupyter process already.

@pazzo83
Copy link
Author

pazzo83 commented Aug 20, 2015

Thanks for all your help! Got it working running 0.4-dev (a version from July 28th). Probably an IPython thing, but the 0.3.11 Julia version was still showing up in the drop down from the main page, even though I've long since deleted that kernel (I basically removed the .ipython folder entirely before I checked out the IJulia master branch, then let it rebuild it running Pkg.build("IJulia")). Anyways, that strange srand error is now gone as well.

Thanks!!

@stevengj
Copy link
Member

I will be pushing an update to Compat soon that will fix the srand issue on 0.3. (It turned out to be fairly involved; there was quite a lot of code that was added to 0.4 in order to expand random-number support for non-global state.)

@stevengj
Copy link
Member

Okay, with Compat 0.6 it should work again with Julia 0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants