Can't get Julia to work in VS Code

Hi.

I have been endlessly trying to get Julia to work with my VS Code. I removed VS Code from my computer multiple times. I removed the Julia extension multiple times. I downgraded from 1.5.4 to 1.0.5. This is still what I get.

This path does indeed exist.

This is my settings.json file:

{
    "[julia]": {

        "editor.quickSuggestions": true,
        "editor.wordSeparators": "`~#$%^&*()-=+[{]}\\|;:'\",.<>/?"
    },
    "julia.executablePath": "/home/onur/julia-1.0.5/bin/julia"
}

I have Julia in my system. I have the extension installed and I’ve been dealing with this for a while now.

can you show us the output of

ls -alFh /home/onur/julia-1.0.5/bin/julia

in your terminal?

-rwxr-xr-x 1 onur onur 47K Sep 9 2019 /home/onur/julia-1.0.5/bin/julia*

Can you manually run julia from that directory i.e.:

cd /home/onur/julia-1.0.5/bin
./julia

Yep

Are you on Ubuntu by chance? I believe VS Code on Ubuntu installs inside using their “snap” sandbox or whatever that is. It’s sandboxed to the point that it can’t execute anything in the home directory. I think if you install Ubuntu’s Julia you will be fine. If you want to use the official julia build try unzipping it in /opt or maybe under /usr/local somewhere. You might be able to execute it from those location…maybe.

1 Like

I don’t know if this is the solution, but have you tried putting /home/onur/julia-1.0.5/bin/as the path without the binary at the end?

It doesn’t work with the plugin either. And yes I’m on Ubuntu.

What do you mean?

Instead of

"julia.executablePath": "/home/onur/julia-1.0.5/bin/julia"

try

"julia.executablePath": "/home/onur/julia-1.0.5/bin/"

I have an Ubuntu VM I keep clean, I just cloned it installed VS Code and Julia, and it works for me. :confused:


Check the Julia extension, is it at 1.1.37? Did I get the same version of Visual Studio Code?

Just changed it. Same problem.

This is why I despise Visual Studio Code so much. See, I got this to work with Atom/JUNO just via the standard installation route.

That error is weird – it’s definitely not thrown directly by the Julia extension. Couple of questions:

  1. How did you install VSCode?
  2. What version of VSCode/the Julia extension do you have?
  3. Did you try symlinking the Julia binary to e.g. `/usr/local/bin/julia’ and then deleting the path setting?
  1. Snap
  2. v1.1.37
  3. Could you elaborate?
1 Like

sudo ln -sf /home/onur/julia-1.0.5/bin/julia /usr/local/bin/julia
and then check that you can run julia just by typing julia

I’d recommend trying a normal install then.

snap works fine for me and allow to easily follow the frequent updates

1 Like

I am having trouble with VS Code too. It’s a pain in the ass. It does NOT see Julia even though it is installed!

moving my julia folder to /opt solved the problem, thanks!
I’m using
-julia 1.9.1
-Ubuntu 20.04.6 LTS
-VSCode 1.79.2