Test if Julia is installed

Hi all,

Is there a simple & OS-independent way to check if Julia is installed? Is it further possible to check ‘on-the-fly’ which Julia version is installed?

My use case: I am running tests of an R package against a Julia package and want to default to not running the tests if I find that Julia is not installed.

Here is a related stackoverflow thread to test if Python is installed, from within R.


Pray tell me what programming language will the “test to check if Julia is installed” be running in? I hope the test is not written in Julia Language.

1 Like

Hi @StevenSiew, I am afraid I don’t fully understand your question - my exact use case is to check if Julia is installed from within R.

Not sure about R but usually these things go like, check if julia is available on the PATH, if not check the normal installation locations for the OS that you’re on. I don’t know from the top of my head what these are but should be easy enough to find out. The version you can then get for example by running versioninfo() in Julia

1 Like

In R, try
system2(command="julia", args="--version")
and catch the error if it doesn’t exist; for example,

tryCatch(system2(command="juli1a", args="--version"), error = print("Julia not found"))