hi all,
after digging around with documentation, I still don’t quite understand how Julia handles project/environments.
So to describe what I am trying to do - I’ve created a new folder to house julia files related to the project, and I want it to use specific version of packages, separate from what the main environment is using.
I went to REPL, and run
“active Z:/project/Project1”
which activated the new env… I’ve added packages to it - it created a new (as documentation said) Manifest & Project toml files in the folder along with the jl files there.
But when I compile/run those jl files in VS Code, it ignores the .toml files in the folder, and just defaults to using the main environment.
meaning, I have ProjectA.jl in folder with Manifest.toml & Project.toml, with a bunch of
“using PackageABC” to kick off the script in ProjectA.jl, but it’s clearly going back to main environment to use packages there.
I cant quite figure out what I need to do to get it to use those .toml files. How do I get a script to run starting in a specific environment?
julia documentation gives this hint to just force entire environment - but it’s from command line:
Instead of using activate
from within Julia you can specify the project on startup using the --project=<path>
flag. For example, to run a script from the command line using the environment in the current directory you can run
$ julia --project=. myscript.jl