Add package bad message

This is already a open issue right?

I try to use a package, if it fails is asks me to use the wrong pkg manager.

julia> using Colors
ERROR: ArgumentError: Package Colors not found in current path:
- Run `Pkg.add("Colors")` to install the Colors package.

Stacktrace:
 [1] require(::Module, ::Symbol) at .\loading.jl:817

julia> Pkg.add("Colors")
ERROR: UndefVarError: Pkg not defined
Stacktrace:
 [1] top-level scope at none:0

julia>

btw 1.0 looks great :smile:

1 Like
using Pkg: add
add("PkgName")

or

using Pkg
Pkg.add("PkgName")

Yes. In addition: the error message will be updated in a future release, the PR has already been merged: https://github.com/JuliaLang/julia/pull/28555.

2 Likes

That should have probably been using, but better.