Basic script:
me@pc:/tmp/testenv$ less /tmp/testproj/test.jl
using Optim,DataFrames
DataFrame(rand(3,3))
Project has all deps:
me@pc:/tmp/testenv$ less /tmp/testproj/Project.toml
./Project.toml
me@pc:/tmp/testenv$ less /tmp/testproj/Project.toml
[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
Project.toml (END)
According to the docs, the correct way to specify a project when calling in bash is:
me@pc:/tmp/testenv$ julia -p 5 --project=/tmp/testproj ./test.jl
This is super annoying:
No info about the status of the project that I requested to be activated, just apparently silently failing:
ERROR: LoadError: ArgumentError: Package Optim not found in current path:
- Run `import Pkg; Pkg.add("Optim")` to install the Optim package.
Try ignoring the docs and use interactive way:
me@pc:/tmp/testenv$ less /tmp/testproj/test.jl
using Pkg
Pkg.activate("/tmp/testproj")
using Optim,DataFrames
DataFrame(rand(3,3))
Exact same problem:
ERROR: LoadError: ArgumentError: Package Optim not found in current path:
- Run `import Pkg; Pkg.add("Optim")` to install the Optim package.