Installing Pluto.jl notebook for Julia language

 What is pluto.jl

TBD

How to install Julia?

Install Julia language from https://julialang.org/

Start Julia 
    I can do that from Terminal,
    or by clicking an icon
Once Julia's prompt opens,
    click the closing bracket ] to enter the "package mode"


How to Install pluto.jl?


Simply type 


(@v1.7) pkg> add Pluto.jl


The installation is very fast.

Press BACKSPACE to exit the package mode

 Type 



julia> using Pluto
julia> Pluto.run()

At this point, the pluto website should open in your browser:



How to execute Julia code in VS code editor with Julia Language Support plugin?

In VS code,

with the Julia Language Support plugin installed,

with Julia installed on my macOS,


% which julia
/Applications/Julia-1.7.app/Contents/Resources/julia/bin/julia


 When trying to run (Shift-Enter, or RUN icon) Julia in VS code I got this error:



command 'language-julia.executableCodeBlockOrSelectionAndMove' not found



Solution

  • I reinstalled the VS code plugin
  • I rechecked the PATH (see above)
  • I CLOSED and RE-OPENED the VS code
And voila, it works. Not very scientific, but I am happy. 









References







How to add VS code executable to the command line on macOS?

 







% nano .zprofile

#### VS code - Uki 2022-06-26 ####
## set PATH to "code" executable so it is available directly from Terminal
export PATH="\$PATH:/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin"
## the following line is the key to launch "code" from the command line
alias code='/Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron'




After adding these lines, save it in NANO by pressing 

control x 

Do not forget to double-check your work.

% cat .zprofile 

And re-run the content of the .zprofile: 

% . ~/.zprofile
 
 

How to add "julia" executable to the PATH on macOS

 





% nano .zprofile

#### Julia - Uki 2022-06-26 ####
## set PATH to "julia" executable so it is available directly from Terminal
export PATH="\$PATH:/Applications/Julia-1.7.app/Contents/Resources/julia/bin"

Make sure to change to the version of Julia you have, check the path.
After adding these lines, save it in NANO by pressing 

control x 



 Do not forget to double-check your work.

% cat .zprofile

Is .zprofile replacing .bash_profile in macOS?

 In the macOS 12+ (Monteray, etc.) the .zprofile is replacing .bash_profile