Genie Discord forum
@Rabbit38 I have run into many errors until I was able to get my Julia / Genie Builder environment working properly. I was actually able to write my first web app only today.
So, I am going to give you some of the best advice that I had gotten and hopefully save you some time
So, VS Code terminal and your system terminal may be relying on different paths. In my case, my path changes in VS Code would be reset each time the application started. It was annoying.
Try running "where julia" (I use Linux, so I had to run "which julia") in both the windows command prompt and the VS Code command prompt. Make sure that they match.👍
They should display the location of the julia executable. Then, verify that the executable is actually there.
This is important, because I used juliaup install julia (originally I downloaded and manually installed). I had to remove the old path and since VS Code kept ignoring my path changes, I just used static links to where juliaup installed the executable.
I did notice that somewhere I had found instructions to add a specific path to my $PATH envioronmental variable as part of the installation process, but it ended up NOT CORRECT instructions as juliaup installed the executable in a different folder. So, as part of due diligence, trust but verify the path to the julia executable. ✅
And again, I used static links to the executable, and added them to a folder which was consistenly part of the VS Code path.
I'm not having any luck with your suggestions. "where julia" doesn't work in the REPL nor at the PS command line.
You would need the regular command line. Maybe search for julia.exe using windows explorer... as a last resort
It was a real headache for me because VS Code kept obliterating my PATH changes... so linking is definitely the way to go
Also, I could still do a lot of work in Genie Builder... and I thought running a REPL and installing packages would work... but it was actually the WRONG move for working in Genie Builder. Stick to the Genie Builder Package Manager and save yourself a headache (because I thought it was working in a different environment)
When my path was not correct, Package Manager would run... but it would freeze up. When I Launched a REPL, I could actually get further and complete an installation. All for not. It did not help, felt like wrong environment, and I pulled out my hair trying to fix it...... and it was a path problem afterall.
Hi @Rabbit38 . As @GenerallyClueless pointed out, there seems to be an issue with your PATH. Are you able to run Julia from a terminal?
Yes. I launched the Command Prompt, typed Julia and it started up the REPL. Thanks for your reply, I was offline yesterday.
Good first step @Rabbit38. Have you also done this within VS Code itself? I have to make mention again that VS Code may not share the same environmental variables as the command prompt. This gave me a headache because each time I restarted VS Code I would lose my PATH changes. So, I made a link to the julia executable and placed it within a folder that VS Code and Command Prompt both shared, rather than appending to PATH.
@GenerallyClueless , I have not been able to figure out how to do what you suggest. How do I test launching Julia in VS Code other that what I do now. I launch VS Code and Julia is also started. How do you see what VS Code is using? I also see the Start Server icon, which when clicked tries to start the Genie Server causing the error as shown in the error message. How do I accomplish your link suggestion?
Thanks @Pere. Yes. I launched the Command Prompt, typed Julia and it started up the REPL.
@Rabbit38 I have no doubt that you are running the terminal correctly. I am just trying to emphasize that VS Code terminal loads different environmental variables than a terminal like command prompt. It caused me to have a headache because I would add the julia executable to my $PATH ... but the path would always revert to a previous state.
Also, I could still perform some actions with julia, like start the genie builder server, install dependencies etc... using Pkg which made it feel like it was working correctly, but unfortunately my tools were not set up correctly.
⭐ @Rabbit38 My advice, is to:
- Echo the PATH and make sure that VS Code terminal has the same path as your command prompt (there may be some differences)
- Find the actual installation directory of julia executable, and
- create a link to the julia executable and put it in a folder common to the PATH in VS Code terminal and command prompt ⭐
@GenerallyClueless I appologize for being so dense. (1): In VS Code, if I open a new terminal and type "echo PATH" without the "s, it returns "PATH" again without the parens. Typing the same thing in the REPL returns a syntax error. (2): julia.exe is at: C:\Users\Harvey\AppData\Local\Programs\Julia-1.7.1\bin. (3): I'm pretty computer literate but totally clueless how to do this step. a) how to create a link?, b) how to find the common folder?. I'm wondering if we are in totally different computer worlds. My VS Code About: Version: 1.79.2 (user setup) Commit: 695af097c7bd098fbf017ce3ac85e09bbc5dda06 Date: 2023-06-14T08:57:04.379Z Electron: 22.5.7 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.22621
@GenerallyClueless on a Win 10 PC
Okay @Rabbit38 I think you need to type: echo %Path% forgive me... I hardly do anything technical in Windows, so I had to look this up 😳
I think the easiest way to create the link is to open Windows Explorer.... navigate to C:\Users\Harvey\AppData\Local\Programs\Julia-1.7.1\bin\ ... then right click on julia.exe and "create shortcut"..... then cut/paste the shortcut to some sensible folder in your %Path
Problem Solved: I noted that I was not using the lasted stable version of Julia. I just upgraded to 1.9.2 and now I can start Genie Builder. Thusly, I can move on to exploring and using this tool. @GenerallyClueless and @Pere, big thanks for your help. BTW: I found a method that works for getting the VS Code PATH on my system: In VSCode, Preferences, Settings, type in the Search Box: julia.executablePath.
Good to hear @Rabbit38 thanks for the notice