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 following the instructions on the website.
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
- Launch a julia session (either by launching the app, or typing
juliaon the command line if you have that set up). - Type
]to enterPkgmode. - Type
add Korgto install Korg and its dependencies. - Press backspace or
CTRL+Cto exitPkgmode (and return to the Julia REPL)
Alternatively, you can run
julia> using Pkg
julia> Pkg.add("Korg")If you are coming from Python, we also recommend installing IJulia (for using Julia from Jupyter/IPython notebooks), and PythonPlot (for calling matplotlib from Julia).
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
pip install juliapkgThen, to install Korg, do this from a Python shell:
import juliapkg
juliapkg.add("Korg", "acafc109-a718-429c-b0e5-afd7f8c7ae46")
juliapkg.resolve()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.KorgKeeping 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")