Using StaticArrays on 0.7 fails [SOLVED]


#1

I installed StaticArrays on Version 0.7.0-DEV.5216 (2018-05-24 18:04 UTC),
using the new package manager.

While the installation seams to work, using it fails:

julia> using StaticArrays
[ Info: Precompiling module StaticArrays
ERROR: LoadError: ArgumentError: Module Pkg not found in current path.
Run `Pkg.add("Pkg")` to install the Pkg package.
Stacktrace:
 [1] _require(::Base.PkgId) at ./loading.jl:949
 [2] require(::Base.PkgId) at ./loading.jl:877
 [3] require(::Module, ::Symbol) at ./loading.jl:872
 [4] top-level scope at /home/ufechner/.julia/packages/Compat/vafh/src/Compat.jl:1457
 [5] include at ./boot.jl:314 [inlined]
 [6] include_relative(::Module, ::String) at ./loading.jl:1070
 [7] include(::Module, ::String) at ./sysimg.jl:29
 [8] top-level scope
 [9] eval at ./boot.jl:316 [inlined]
 [10] eval(::Expr) at ./client.jl:391
 [11] macro expansion at ./none:3 [inlined]
 [12] top-level scope at ./<missing>:0
in expression starting at /home/ufechner/.julia/packages/Compat/vafh/src/Compat.jl:1457
ERROR: LoadError: Failed to precompile Compat to /home/ufechner/.julia/compiled/v0.7/Compat/GSFW.ji.
Stacktrace:
 [1] error at ./error.jl:33 [inlined]
 [2] compilecache(::Base.PkgId) at ./loading.jl:1206
 [3] _require(::Base.PkgId) at ./loading.jl:977
 [4] require(::Base.PkgId) at ./loading.jl:877
 [5] require(::Module, ::Symbol) at ./loading.jl:872
 [6] top-level scope at /home/ufechner/.julia/packages/StaticArrays/86zB/src/StaticArrays.jl:29
 [7] include at ./boot.jl:314 [inlined]
 [8] include_relative(::Module, ::String) at ./loading.jl:1070
 [9] include(::Module, ::String) at ./sysimg.jl:29
 [10] top-level scope
 [11] eval at ./boot.jl:316 [inlined]
 [12] eval(::Expr) at ./client.jl:391
 [13] macro expansion at ./none:3 [inlined]
 [14] top-level scope at ./<missing>:0
in expression starting at /home/ufechner/.julia/packages/StaticArrays/86zB/src/StaticArrays.jl:29
ERROR: Failed to precompile StaticArrays to /home/ufechner/.julia/compiled/v0.7/StaticArrays/yY9v.ji.
Stacktrace:
 [1] error at ./error.jl:33 [inlined]
 [2] compilecache(::Base.PkgId) at ./loading.jl:1206
 [3] _require(::Base.PkgId) at ./loading.jl:1006
 [4] require(::Base.PkgId) at ./loading.jl:877
 [5] require(::Module, ::Symbol) at ./loading.jl:872

Any idea?


#2

I actually also tried the suggestion:

`Pkg.add("Pkg")`

But it did not help.


#3

Try to get the master, I assume Pkg.checkout still works. You might also need the master version of other packages (test them one by one as they appear in the error message). Otherwise look at issues on github, a lot of packages are still WIP on v0.7.


#4

This issue in particular is due to very recent changes in Julia 0.7, see Rename Pkg -> OldPkg, Pkg3 -> Pkg. Things are temporarily a bit more unstable than they usually are even for a DEV version.

You could use the fork of Compat.jl that Kristoffer mentions in the PR, or if you’re not doing development work on Julia itself, perhaps you could go with a 0.7 build that’s a few days older, at least until things settle down with these Pkg changes.


#5

I tried your suggestion, but it doesn’t help:

julia> Pkg.checkout("StaticArrays.jl")
WARNING: Base.Pkg is deprecated, run `using Pkg` instead
 in module Main
┌ Warning: `checkout` is deprecated, use `develop` instead.
│   caller = top-level scope
â”” @ Core :0
 Resolving package versions...
  Updating `~/.julia/environments/v0.7/Project.toml`
 [no changes]
  Updating `~/.julia/environments/v0.7/Manifest.toml`
 [no changes]

julia> using StaticArrays
[ Info: Precompiling module StaticArrays
ERROR: LoadError: ArgumentError: Module Pkg not found in current path.
Run `Pkg.add("Pkg")` to install the Pkg package.
Stacktrace:
 [1] _require(::Base.PkgId) at ./loading.jl:949
 [2] require(::Base.PkgId) at ./loading.jl:877
 [3] require(::Module, ::Symbol) at ./loading.jl:872
 [4] top-level scope at /home/ufechner/.julia/packages/Compat/vafh/src/Compat.jl:1457
 [5] include at ./boot.jl:314 [inlined]
 [6] include_relative(::Module, ::String) at ./loading.jl:1070
 [7] include(::Module, ::String) at ./sysimg.jl:29
 [8] top-level scope
 [9] eval at ./boot.jl:316 [inlined]
 [10] eval(::Expr) at ./client.jl:391
 [11] macro expansion at ./none:3 [inlined]
 [12] top-level scope at ./<missing>:0
in expression starting at /home/ufechner/.julia/packages/Compat/vafh/src/Compat.jl:1457
ERROR: LoadError: Failed to precompile Compat to /home/ufechner/.julia/compiled/v0.7/Compat/GSFW.ji.
Stacktrace:
 [1] error at ./error.jl:33 [inlined]
 [2] compilecache(::Base.PkgId) at ./loading.jl:1206
 [3] _require(::Base.PkgId) at ./loading.jl:977
 [4] require(::Base.PkgId) at ./loading.jl:877
 [5] require(::Module, ::Symbol) at ./loading.jl:872
 [6] top-level scope at /home/ufechner/.julia/packages/StaticArrays/86zB/src/StaticArrays.jl:29
 [7] include at ./boot.jl:314 [inlined]
 [8] include_relative(::Module, ::String) at ./loading.jl:1070
 [9] include(::Module, ::String) at ./sysimg.jl:29
 [10] top-level scope
 [11] eval at ./boot.jl:316 [inlined]
 [12] eval(::Expr) at ./client.jl:391
 [13] macro expansion at ./none:3 [inlined]
 [14] top-level scope at ./<missing>:0
in expression starting at /home/ufechner/.julia/packages/StaticArrays/86zB/src/StaticArrays.jl:29
ERROR: Failed to precompile StaticArrays to /home/ufechner/.julia/compiled/v0.7/StaticArrays/yY9v.ji.
Stacktrace:
 [1] error at ./error.jl:33 [inlined]
 [2] compilecache(::Base.PkgId) at ./loading.jl:1206
 [3] _require(::Base.PkgId) at ./loading.jl:1006
 [4] require(::Base.PkgId) at ./loading.jl:877
 [5] require(::Module, ::Symbol) at ./loading.jl:872

julia> 

Any idea?


#6

Well, I just want to learn how to use the new package manager. So I guess I rather wait a little bit. :slight_smile:


#7

Everything should be working fine now. Some people have had problems for some reason when they had old registries so try rm -r ~/.julia/registries/Uncurated and then pkg> up.

For example:

(Pkg) pkg> add StaticArrays
  Updating registry at `~/.julia/registries/Uncurated`
  Updating git-repo `https://github.com/JuliaRegistries/Uncurated.git`
 Resolving package versions...
  Updating `Project.toml`
  [90137ffa] + StaticArrays v0.7.0
....
julia> using StaticArrays
[ Info: Recompiling stale cache file /Users/kristoffer/.julia/compiled/v0.7/StaticArrays/yY9v.ji for module StaticArrays
WARNING: importing deprecated binding LinearAlgebra.trace into StaticArrays.

julia>

#8

Thanks for your reply, but it doesn’t help:

rm: cannot remove '/home/ufechner/.julia/registries/Uncurated': No such file or directory
ufechner@TUD277255:~/julia$ ./julia 
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.7.0-DEV.5216 (2018-05-24 18:04 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 3b4fbf3* (0 days old master)
|__/                   |  x86_64-linux-gnu

julia> add StaticArrays
ERROR: syntax: extra token "StaticArrays" after end of expression

(v0.7) pkg> add StaticArrays
 Resolving package versions...
ERROR: Unsatisfiable requirements detected for package StaticArrays [90137ffa]:
 StaticArrays [90137ffa] log:
 ├─StaticArrays [90137ffa] has no known versions!
 └─restricted to versions 0.7.0 by an explicit requirement — no versions left

Stacktrace:
 [1] check_constraints(::Pkg.GraphType.Graph) at /home/ufechner/julia/usr/share/julia/stdlib/v0.7/Pkg/src/GraphType.jl:935
 [2] Pkg.GraphType.Graph(::Dict{Base.UUID,Set{VersionNumber}}, ::Dict{Base.UUID,Dict{Pkg.Types.VersionRange,Dict{String,Base.UUID}}}, ::Dict{Base.UUID,Dict{Pkg.Types.VersionRange,Dict{String,Pkg.Types.VersionSpec}}}, ::Dict{Base.UUID,String}, ::Dict{Base.UUID,Pkg.Types.VersionSpec}, ::Dict{Base.UUID,Pkg.Types.Fixed}, ::Bool) at /home/ufechner/julia/usr/share/julia/stdlib/v0.7/Pkg/src/GraphType.jl:362
 [3] deps_graph(::Pkg.Types.Context, ::Dict{Base.UUID,String}, ::Dict{Base.UUID,Pkg.Types.VersionSpec}, ::Dict{Base.UUID,Pkg.Types.Fixed}) at /home/ufechner/julia/usr/share/julia/stdlib/v0.7/Pkg/src/Operations.jl:252
 [4] resolve_versions!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /home/ufechner/julia/usr/share/julia/stdlib/v0.7/Pkg/src/Operations.jl:285
 [5] #add_or_develop#50(::Array{Base.UUID,1}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /home/ufechner/julia/usr/share/julia/stdlib/v0.7/Pkg/src/Operations.jl:965
 [6] #add_or_develop at ./<missing>:0 [inlined]
 [7] #add_or_develop#8(::Symbol, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /home/ufechner/julia/usr/share/julia/stdlib/v0.7/Pkg/src/API.jl:38
 [8] #add_or_develop at ./<missing>:0 [inlined]
 [9] do_add_or_develop!(::Pkg.Types.Context, ::Array{Union{Pkg.Types.VersionRange, String, Pkg.REPLMode.Command, Pkg.REPLMode.Option, Pkg.REPLMode.Rev},1}, ::Pkg.REPLMode.CommandKind) at /home/ufechner/julia/usr/share/julia/stdlib/v0.7/Pkg/src/REPLMode.jl:594
 [10] #invokelatest#1 at ./essentials.jl:667 [inlined]
 [11] invokelatest at ./essentials.jl:666 [inlined]
 [12] do_cmd!(::Array{Union{Pkg.Types.VersionRange, String, Pkg.REPLMode.Command, Pkg.REPLMode.Option, Pkg.REPLMode.Rev},1}, ::REPL.LineEditREPL) at /home/ufechner/julia/usr/share/julia/stdlib/v0.7/Pkg/src/REPLMode.jl:274
 [13] #do_cmd#8(::Bool, ::Function, ::REPL.LineEditREPL, ::String) at /home/ufechner/julia/usr/share/julia/stdlib/v0.7/Pkg/src/REPLMode.jl:234
 [14] do_cmd at /home/ufechner/julia/usr/share/julia/stdlib/v0.7/Pkg/src/REPLMode.jl:231 [inlined]
 [15] (::getfield(Pkg.REPLMode, Symbol("##27#30")){REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at /home/ufechner/julia/usr/share/julia/stdlib/v0.7/Pkg/src/REPLMode.jl:949
 [16] top-level scope

(v0.7) pkg> 

Any idea?


#9

Ah, just remove ~/.julia/registries and try again.


#10

Great now it works! Thank you very much. :smile:


#11

Will future Pkg version work without this hack?