While Korg is written in Julia, it's possible to use it from either Julia or Python.

Using Korg from Julia

1. Install Julia

Install Julia by downloading a binary from the website. See also the platform specific instructions, especially if you would like to use Julia from the command line.

Warning

The latest versions of Korg support Julia 1.7 and greater, so make sure you are not using an older version. (Versions can be installed alongside eachother, and the 1.X versions are backwards compatible.)

2. Install Korg

  1. Launch a julia session (either by launching the app, or typing julia on the command line if you have that set up).
  2. Type ] to enter Pkg mode.
  3. Type add Korg to install Korg and its dependencies.
  4. Press backspace or CTRL+C to exit Pkg mode (and return to the Julia REPL)

Alternatively, you can run

julia> using Pkg
julia> Pkg.add("Korg")
Tip

If you are coming from Python, we also recommend installing IJulia (for using Julia from Jupyter/IPython notebooks), and PyPlot (for calling matplotlib from Julia).

If you want PyPlot to use you existing python/matplotlib installation, just do ENV["PYTHON"] = "/path/to/python" before you install. See here for details.

Using Korg from Python

The recommended way to call Korg from Python is to use juliacall. Here's the quick version:

Install juliacall with

pip install juliacall

Then, to install Korg, do this from a Python shell:

from juliacall import Main as jl
jl.seval("using Pkg")
jl.Pkg.add("Korg")

That's it! To use Korg from Python, just put these lines at the top of your script/notebook.

from juliacall import Main as jl
jl.seval("using Korg")
Korg = jl.Korg

Keeping Korg updated

In order to update Korg in the future, you can type:

Julia:

using Pkg
Pkg.update("Korg")

Python:

from juliacall import Main as jl
jl.seval("using Pkg")
jl.Pkg.update("Korg")