slundberg / IJulia.jl

Julia kernel and magics for IPython

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IJulia logo

IJulia

IJulia is a Julia-language backend combined with the IPython interactive environment. This combination allows you to interact with the Julia language using IPython's powerful graphical notebook, which combines code, formatted text, math, and multimedia in a single document

(This package also includes a prototype Python module to call Julia from Python, including "magics" to call Julia code from within a Python session in IPython.)

Tutorial

High-level installation instructions using precompiled binaries, as well as a basic usage tutorial, can be found in these tutorial notes:

Low-level installation info

First, you will need to install a few prerequisites:

  • You need version 1.0 or later of IPython. Note that IPython 1.0 was released in August 2013, so the version pre-packaged with operating-system distribution is likely to be too old for the next few weeks or months. Until then, you may have to install IPython manually. On Mac and Windows systems, it is currently easiest to use the Anaconda Python installer.

  • To use the IPython notebook interface, which runs in your web browser and provides a rich multimedia environment, you will need to install the Jinja2, Tornado, and pyzmq Python packages. (Given the pip installer, pip install jinja2 tornado pyzmq should be sufficient.) These should have been automatically installed if you installed IPython itself via easy_install or pip.

  • To use the IPython qtconsole interface, you will need to install PyQt4 or PySide.

  • You need Julia version 0.2 (or rather, a recent git master snapshot).

Once IPython 1.0+ and Julia 0.2 is installed, you can install IJulia from a Julia console by typing:

Pkg.add("IJulia")

This will download IJulia and a few other prerequisites, and will set up a Julia profile for IPython.

If the command above returns an error, you may need to run Pkg.update(), then retry it.

Running IJulia

Given the above, you have three choices:

  • The richest interface is the IPython notebook, which you can invoke for Julia by: ipython notebook --profile julia (a window will open in your web browser).

  • A lightweight terminal-like interface that nevertheless supports inline graphics and multiline editing is the IPython qtconsole, which you can invoke for Julia by: ipython qtconsole --profile julia

  • A basic text terminal interface (no graphics) can be invoked for Julia by ipython console --profile julia

Please refer to the IPython documentation for other configuration options. For example, if you plan to connect the notebook front-end to a Julia kernel running on a different machine (yes, this is possible!), we strongly recommend that you run notebook over https with a password. These configuration settings can go in the file: ~/.ipython/profile_julia/ipython_notebook_config.py.

Usage

Once you have launched IJulia via a notebook or console interface, usage is straightforward and is similar to IPython. You can enter multiline input cells and execute them with shift-ENTER, and the menu items are mostly self-explanatory. Refer to the IPython documentation for more information.

(One difference from IPython is that the IJulia kernel currently does not support "magics", which are special commands prefixed with % or %% to execute code in a different language. This and other features are under consideration in the IJulia issues list.)

About

Julia kernel and magics for IPython

License:MIT License


Languages

Language:Julia 72.1%Language:Python 27.9%