Pkg.add("Profile") fails with "Unknown package" in 0.6.2, Feb 2018


#1

are the docs and/or packages broken?

https://docs.julialang.org/en/latest/manual/profile/

suggests

julia> Pkg.add("Profile")
ERROR: unknown package Profile
macro expansion at ./pkg/entry.jl:53 [inlined]
(::Base.Pkg.Entry.##1#3{String,Base.Pkg.Types.VersionSet})() at ./task.jl:335
Stacktrace:
 [1] sync_end() at ./task.jl:287
 [2] macro expansion at ./task.jl:303 [inlined]
 [3] add(::String, ::Base.Pkg.Types.VersionSet) at ./pkg/entry.jl:51
 [4] (::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#add,Tuple{String}})() at ./pkg/dir.jl:36
 [5] cd(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#add,Tuple{String}}, ::String) at ./file.jl:70
 [6] #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{String,N} where N) at ./pkg/dir.jl:36
 [7] add(::String) at ./pkg/pkg.jl:117

probably a simple beginner’s error, though…


#2

I don’t see where it suggests to do a Pkg.add. Just use it, no need to add it, it’s included in the Julia installation.


#3

not in mine, mine being macOS.

julia> using Profile
ERROR: ArgumentError: Module Profile not found in current path.
Run `Pkg.add("Profile")` to install the Profile package.
Stacktrace:
 [1] _require(::Symbol) at ./loading.jl:435
 [2] require(::Symbol) at ./loading.jl:405

#4

Your link points to the docs for Julia master, i.e. the version that will eventually become 0.7, in which it will be necessary to do using Profile. On version 0.6 you can just do e.g. Profile.clear() without any imports. See https://docs.julialang.org/en/stable/manual/profile/#Profiling-1