Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: key "Pkg" not found #965

Closed
timholy opened this issue Dec 12, 2018 · 1 comment
Closed

KeyError: key "Pkg" not found #965

timholy opened this issue Dec 12, 2018 · 1 comment

Comments

@timholy
Copy link
Member

timholy commented Dec 12, 2018

Here's the setup: fairly fresh build of master (1.1.0-DEV.860 (2018-12-11)), delete .julia/environments/v1.1, do a fresh pull on registries/General, remove our private registry, and start without any startup file:

$ ./julia --startup-file=no
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.1.0-DEV.860 (2018-12-11)
 _/ |\__'_|_|_|\__'_|  |  Commit 5b2e3e7* (0 days old master)
|__/                   |

(v1.1) pkg> add Example
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
  Updating `~/.julia/environments/v1.1/Project.toml`
  [7876af07] + Example v0.5.1
  Updating `~/.julia/environments/v1.1/Manifest.toml`
  [7876af07] + Example v0.5.1
  [2a0f44e3] + Base64 
  [8ba89e20] + Distributed 
  [b77e0a4c] + InteractiveUtils 
  [56ddb016] + Logging 
  [d6f4376e] + Markdown 
  [9a3f8284] + Random 
  [9e88b42a] + Serialization 
  [6462fe0b] + Sockets 
  [8dfed614] + Test 

(v1.1) pkg> add FixedPointNumbers ColorTypes
 Resolving package versions...
  Updating `~/.julia/environments/v1.1/Project.toml`
  [3da002f7] + ColorTypes v0.7.5
  [53c48c17] + FixedPointNumbers v0.5.3
  Updating `~/.julia/environments/v1.1/Manifest.toml`
  [3da002f7] + ColorTypes v0.7.5
  [53c48c17] + FixedPointNumbers v0.5.3

(v1.1) pkg> add Reexport
 Resolving package versions...
  Updating `~/.julia/environments/v1.1/Project.toml`
  [189a3867] + Reexport v0.2.0
  Updating `~/.julia/environments/v1.1/Manifest.toml`
  [189a3867] + Reexport v0.2.0
  [ade2ca70] + Dates 
  [76f85450] + LibGit2 
  [44cfe95a] + Pkg-f9180e48b27a843aeee864db814dce57cb296b9b 
  [de0858da] + Printf 
  [3fa0cd96] + REPL 
  [ea8e919c] + SHA 
  [cf7118a7] + UUIDs 
  [4ec0a83e] + Unicode 
ERROR: KeyError: key "Pkg" not found
Stacktrace:
 [1] getindex at ./dict.jl:478 [inlined]
 [2] #109 at /home/tim/src/julia-branch/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:1504 [inlined]
 [3] _all(::getfield(Pkg.Types, Symbol("##109#111")){Dict{String,Bool}}, ::Dict{String,Base.UUID}, ::Colon) at ./reduce.jl:663
 [4] all at ./reduce.jl:658 [inlined]
 [5] destructure(::Dict{Base.UUID,Pkg.Types.PackageEntry}) at /home/tim/src/julia-branch/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:1504
 [6] write_manifest at /home/tim/src/julia-branch/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:1545 [inlined]
 [7] #117 at /home/tim/src/julia-branch/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:1542 [inlined]
 [8] #open#308(::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:truncate,),Tuple{Bool}}}, ::Function, ::getfield(Pkg.Types, Symbol("##117#118")){Dict{Base.UUID,Pkg.Types.PackageEntry}}, ::String) at ./iostream.jl:369
 [9] #open at ./none:0 [inlined]
 [10] write_manifest at /home/tim/src/julia-branch/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:1541 [inlined]
 [11] #write_manifest#119(::Bool, ::Function, ::Dict{Base.UUID,Pkg.Types.PackageEntry}, ::Pkg.Types.EnvCache, ::Pkg.Types.EnvCache, ::Pkg.Types.Context) at /home/tim/src/julia-branch/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:1557
 [12] #write_manifest at ./none:0 [inlined]
 [13] #write_env#120 at /home/tim/src/julia-branch/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:1564 [inlined]
 [14] write_env at /home/tim/src/julia-branch/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:1561 [inlined]
 [15] #add_or_develop#63(::Array{Base.UUID,1}, ::Symbol, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /home/tim/src/julia-branch/usr/share/julia/stdlib/v1.1/Pkg/src/Operations.jl:1173
 [16] #add_or_develop at ./none:0 [inlined]
 [17] #add_or_develop#15(::Symbol, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /home/tim/src/julia-branch/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:54
 [18] (::getfield(Pkg.API, Symbol("#kw##add_or_develop")))(::NamedTuple{(:mode,),Tuple{Symbol}}, ::typeof(Pkg.API.add_or_develop), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at ./none:0
 [19] do_add!(::Dict{Symbol,Any}, ::Array{Pkg.Types.PackageSpec,1}, ::Dict{Symbol,Any}) at /home/tim/src/julia-branch/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:659
 [20] #invokelatest#1(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:742
 [21] invokelatest(::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:741
 [22] do_cmd!(::Pkg.REPLMode.PkgCommand, ::REPL.LineEditREPL) at /home/tim/src/julia-branch/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:561
 [23] #do_cmd#30(::Bool, ::Function, ::REPL.LineEditREPL, ::String) at /home/tim/src/julia-branch/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:536
 [24] do_cmd at /home/tim/src/julia-branch/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:532 [inlined]
 [25] (::getfield(Pkg.REPLMode, Symbol("##48#51")){REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at /home/tim/src/julia-branch/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:967
 [26] #invokelatest#1 at ./essentials.jl:742 [inlined]
 [27] invokelatest at ./essentials.jl:741 [inlined]
 [28] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /home/tim/src/julia-branch/usr/share/julia/stdlib/v1.1/REPL/src/LineEdit.jl:2273
 [29] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /home/tim/src/julia-branch/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:1035
 [30] run_repl(::REPL.AbstractREPL, ::Any) at /home/tim/src/julia-branch/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:192
 [31] (::getfield(Base, Symbol("##732#734")){Bool,Bool,Bool,Bool})(::Module) at ./client.jl:362
 [32] #invokelatest#1 at ./essentials.jl:742 [inlined]
 [33] invokelatest at ./essentials.jl:741 [inlined]
 [34] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:346
 [35] exec_options(::Base.JLOptions) at ./client.jl:284
 [36] _start() at ./client.jl:436

(v1.1) pkg> 

But using Pkg works fine.

I remember seeing an alarming message when I did some kind of update; it was something along the lines of

[some uuid] - Pkg
[some uuid] + Pkg.aks824j1473a

where of course the specific string is just made up junk to convey the spirit of this. Wish I'd copy/pasted the actual events. But this was the beginning of this problem.

@fredrikekre
Copy link
Member

You need to clean the usr directory in your repo, c.f. Jameson's comment: JuliaLang/julia#30075 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants