I have the Julia application on my Mac as follows:
$ alias julia
alias julia='exec '\''/Applications/Julia-0.4.5.app/Contents/Resources/julia/bin/julia'\'''
I'd like to be able to call Julia from Python (or a Jupyter/IPython notebook):
from julia import Julia
However, in the next step, none of the following methods work:
jl = Julia()
jl = Julia(jl_init_path="/Applications/Julia-0.4.5.app/Contents/Resources/julia/bin")
jl = Julia(jl_init_path="/Applications/Julia-0.4.5.app/Contents/Resources/")
In the latter case, I'm getting the following error:
FileNotFoundError: [Errno 2] No such file or directory: '/Applications/Julia-0.4.5.app/Contents/Resources/usr/bin/julia'
So obviously it's trying to find a path to Julia that starts with usr/bin/julia
. However, there is no usr/
folder in /Applications/Julia-0.4.5.app
. What's the best way to fix this?
I set up a symbolic link from my /usr/local/bin
directory (note: you'll probably need to use sudo to do this):
ln -s /Applications/Julia-0.4.5.app/Contents/Resources/julia/bin/julia /usr/local/bin/julia
I use /usr/local/bin
, you may need to change that to /usr/bin
, if your version of Mac OS X allows that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With