I’ve installed Julia - using a Mac.
I’ve created my first julia file and saved it in my Folder on my Desktop as a .jl file using Brackets (as text editor). When I launch Julia and type: include(“Example1.jl”) enter
I get an error!
SystemError: opening file “/Users/kassen/Example1.jl”: No such file or directory
Your file seems to lie in
/Users/kassen/Desktop/<somefolder>/Example.jl whereas Julia by default starts in your home directory, i.e.
/Users/kassen. You have a few options to get things working:
- Use absolute path:
cd into the directory of the file:
cd("/Users/kassen/Desktop/<somefolder>") followed by
- Start Julia in the directory
/Users/kassen/Desktop/<somefolder>/ in the first place: use e.g. Terminal or iTerm2 to navigate to the folder and then start julia with the
Welcome @Derrick_Kassen !
Try to run the script with:
If you are learning Julia for the first time, consider trying things out in Pluto, it is a good platform for beginners because it handles package installation, shows the results right away, etc.
Thank you & Merry Christmas to you 2!