"command not found: julia" when running a UNIX executable

Recently I’ve really been trying to get into Genie. To launch a Genie app, you either have to memorize a long command or just run one of 4 executables located in the bin directory.

I noticed I was getting an error

“command not found: julia”

I won’t pretend to be a shell expert so I’m here to ask for help. It was set to run in sh and I’m on a MacOS Catalina which seems to have switched to zsh. I’ve tried changing the shebang to:

#!/bin/zsh

and am still getting “command not found: julia”. I can run the command if I copy paste it into my terminal so what gives?

You have to make sure julia is in your PATH if you want to run it from the command line. On MacOS, I usually create a link:

sudo ln -s /Applications/Julia-1.4.app/Contents/Resources/julia/bin/julia /usr/local/bin/julia

to create a symbolic link /usr/local/bin/julia to the Julia “app” installed in your Applications folder.

4 Likes

I can run the command if I copy paste it into my terminal so what gives?

Oh sorry, I forgot to explicitly mention julia was already is in my PATH. Like I said, copying the full command into the terminal works just fine, but it’s somehow missing from the PATH for bin/sh, if that makes any sense. It shouldn’t be any different? Is it?

Depends on how you set your PATH. If you set it in ~/.bash_profile, that won’t do it for /bin/sh, for example. (I think /bin/sh uses ~/.profile.)

3 Likes