目标:使用Pkg模块的status命令获取已安装的软件包的详细信息
程序:
$ julia
julia> ]
(v1.1) pkg> status
输出:
ERROR: Pkg.TOML.ParserError(258, 263, "duplicate key `Dates`")
Stacktrace:
[1] parse(::IOStream) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/ext/TOML/src/TOML.jl:33
[2] #open#310(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::typeof(Pkg.TOML.parse), ::String, ::Vararg{String,N} where N) at ./iostream.jl:369
[3] open at ./iostream.jl:367 [inlined]
[4] parsefile(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/ext/TOML/src/TOML.jl:46
[5] load_stdlib() at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:338
[6] Pkg.Types.Context() at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:347
[7] Context!(::Array{Pair{Symbol,Any},1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:368
[8] Context! at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:526 [inlined]
[9] do_status!(::Dict{Symbol,Any}, ::Array{Pkg.Types.PackageSpec,1}, ::Dict{Symbol,Any}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:603
[10] #invokelatest#1(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:742
[11] invokelatest(::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:741
[12] do_cmd!(::Pkg.REPLMode.PkgCommand, ::REPL.LineEditREPL) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:561
[13] #do_cmd#30(::Bool, ::Function, ::REPL.LineEditREPL, ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:536
[14] do_cmd at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:532 [inlined]
[15] (::getfield(Pkg.REPLMode, Symbol("##48#51")){REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:967
[16] #invokelatest#1 at ./essentials.jl:742 [inlined]
[17] invokelatest at ./essentials.jl:741 [inlined]
[18] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/REPL/src/LineEdit.jl:2273
[19] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:1035
[20] run_repl(::REPL.AbstractREPL, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:192
[21] (::getfield(Base, Symbol("##734#736")){Bool,Bool,Bool,Bool})(::Module) at ./client.jl:362
[22] #invokelatest#1 at ./essentials.jl:742 [inlined]
[23] invokelatest at ./essentials.jl:741 [inlined]
[24] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:346
[25] exec_options(::Base.JLOptions) at ./client.jl:284
[26] _start() at ./client.jl:436
观察:
日期及其相关程序包只有一个uuid,如下所示:
"/opt/julia/julia-1.1.0/share/julia/stdlib/v1.1/Dates/Project.toml"
name = "Dates"
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
...
及其相关的软件包:
"/opt/julia/julia-1.1.0/share/julia/stdlib/v1.1/<PACKAGE_NAME>/Project.toml"
...
[deps]
...
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
...
请帮助我解决Pkg的重复密钥问题!