] Doesn't work on Atom's JuliaPro


#1

If I want to enter the Package environment and I run:
]
on the main GUI of Atom installed by JuliaPro I get this error:

syntax: unexpected "]"

If I run it on the REPL it works well.
I I run it on VS Code it also works.


#2

Are you writing it in a script?


#3

yes I am.


#4

That doesn’t work. You can use the pkg"..." custom string or Pkg API commands.


#5

I wanted tio follow StatsMakie.jl instructions:

] add AbstractPlotting#master Makie#master https://github.com/JuliaPlots/StatsMakie.jl.git


#6

That tutorial was written with REPL in mind. But you make a good point that maybe tutorials should defer to using Pkg.


#7

I’m lazy, so I have made script files for adding packages and updating packages… because of that, I use Pkg. I sync these script files across several computers using OneDrive. Thus I have a script file for adding packages, addPackages.jl which I run using include("addPackages.jl")… looking somewhat like:

using Pkg
Pkg.add("Plots")
Pkg.add("DifferentialEquations")
Pkg.add("LaTeXStrings")
…

Because of this, I prefer Pkg over ]… I also have an updatePackages.jl script something like:

using Pkg
Pkg.update()
using Plots
using DifferentialEquations
…

Here, my hope is that the using Plots etc. compiles/checks the packages so that they start faster when I actually use them… I typically rund these scripts overnight.

Maybe my procedure is naïve – perhaps there is no gain in the using Plots, etc. – but at least, I can test whether the packages work. The only problem I have with this is that it seems like if one of the addings/usings fail, then the script appears to stop/skip the subsequent statements.


#8

Would this be better: https://julialang.github.io/Pkg.jl/dev/environments/#Precompiling-a-project-1?

Also, Pkg.add accepts a list of names (e.g. Pkg.add(["Plots", "LaTeXStrings", ...])


#9

] works well on VS Code.


#10

but it wont work in any other script you write. if you are trying to make anything that will run on anything other than vs code, you should use Pkg.

I highly recommend you read the documentation. All of your questions can be answered by searching through the documentation.


#11

There is something to be said for other interactive environments emulating the REPL to some extent. That’s why IJulia recognizes inputs starting with ? or ].