1
votes

I am using Pop_os! system (ubuntu based system) and just installed VS Code. I would like to use Julia with it and installed Julia Extension in the VS Code Extension Marketplace. In the extension settings, I typed in the Julia executable path as where I installed it (in my case is: /opt/julia-1.5.3-linux-x86_64/julia-1.5.3/bin/julia.exe). It is able to run code and print hello world in the output window. However, when I try to click "julia: Execute file" button and run it in Julia REPL, it shows me error message:

Command failed: "/opt/julia-1.5.3-linux-x86_64/julia-1.5.3/bin/" --startup-file=no --history-file=no -e "using Pkg; println(dirname(Pkg.Types.Context().env.project_file))"
/bin/sh: 1: /opt/julia-1.5.3-linux-x86_64/julia-1.5.3/bin/: ***Permission denied***
 `"/opt/julia-1.5.3-linux-x86_64/julia-1.5.3/bin/" --startup-file=no --history-file=no -e "using Pkg; println(dirname(Pkg.Types.Context().env.project_file))"` (exited with error code 126) 

I noticed in the previous error message it says "permission denied", so I change the path to where the static link is located "/usr/local/bin/julia.exe", but in this case it shows me the same "permission denied" error message.

Does anyone know how to get around this issue?

Thanks!

1
Two things seem strange here: (1) why the ".exe" suffix for your julia executable on Linux? And (2) why would VS code try to execute "/opt/julia-1.5.3-linux-x86_64/julia-1.5.3/bin/" (a directory) instead of the executable that's in it? Could you double-check the path you entered in the VS code extension settings? - François Févotte
Thanks François Févotte for the comments. You are right there should be a ".exe" suffix. The Julia executable directory is correct. I read from ferrolho.github.io/blog/2019-01-26/… that there is no need to define anything after install julia extension in vs code. I uninstall and reinstalled vs code, and make sure I don't sync vs code account (it was used on a windows machine). This time it is working. Thank you for taking your time replying! - Wenlong Zhang

1 Answers

0
votes

The cause of the issue is when I installed vs code on linux, I accidentally synced the accounted settings I used in a windows laptop, and that seems to mess up the Julia extension (I used to use Julia extension in windows vs code). I tried uninstall and reinstall vs code, and make sure I don't sync my windows account settings, this time julia extension works for me right after installing it. I don't even need to define any paths.