2

我今天刚刚安装了 julia,我尝试添加图像包,但它不起作用。它确实获取到 100%。然后它保持获取大约 4 分钟,没有发生这样的事情:

(@v1.4) pkg> add Images
    Cloning default registries into `C:\Users\Quinten Cabo\.julia`
    Cloning registry from "https://github.com/JuliaRegistries/General.git"
    Fetching: [========================================>]  100.0 %

然后 4 分钟后我得到这个错误:

    Cloning default registries into `C:\Users\Quinten Cabo\.julia`
    Cloning registry from "https://github.com/JuliaRegistries/General.git"
ERROR: SystemError: opening file "C:\\Users\\Quinten Cabo\\.julia\\registries\\General\\Registry.toml": No such file or directory
Stacktrace:
 [1] systemerror(::String, ::Int32; extrainfo::Nothing) at .\error.jl:168
 [2] #systemerror#50 at .\error.jl:167 [inlined]
 [3] systemerror at .\error.jl:167 [inlined]
 [4] open(::String; read::Bool, write::Nothing, create::Nothing, truncate::Nothing, append::Nothing) at .\iostream.jl:254
 [5] open(::String, ::String) at .\iostream.jl:310
 [6] open(::typeof(Pkg.TOML.parse), ::String, ::Vararg{String,N} where N; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at .\io.jl:296
 [7] open at .\io.jl:296 [inlined]
 [8] parsefile at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\ext\TOML\src\TOML.jl:50 [inlined]
 [9] read_registry(::String; cache::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Types.jl:974
 [10] read_registry at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Types.jl:969 [inlined]
 [11] (::Pkg.Types.var"#92#95"{Pkg.Types.Context,String,Pkg.Types.RegistrySpec})(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Types.jl:946
 [12] mktempdir(::Pkg.Types.var"#92#95"{Pkg.Types.Context,String,Pkg.Types.RegistrySpec}, ::String; prefix::String) at .\file.jl:682
 [13] mktempdir at .\file.jl:680 [inlined] (repeats 2 times)
 [14] clone_or_cp_registries(::Pkg.Types.Context, ::Array{Pkg.Types.RegistrySpec,1}, ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Types.jl:911
 [15] clone_or_cp_registries at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Types.jl:902 [inlined] (repeats 2 times)
 [16] clone_default_registries(::Pkg.Types.Context) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Types.jl:821
 [17] find_registered!(::Pkg.Types.Context, ::Array{String,1}, ::Array{Base.UUID,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Types.jl:1167
 [18] registry_resolve!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\Types.jl:727
 [19] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; preserve::Pkg.Types.PreserveLevel, platform::Pkg.BinaryPlatforms.Windows, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:146
 [20] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:112
 [21] #add#27 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:109 [inlined]
 [22] add(::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:109
 [23] do_cmd!(::Pkg.REPLMode.Command, ::REPL.LineEditREPL) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\REPLMode\REPLMode.jl:403
 [24] do_cmd(::REPL.LineEditREPL, ::String; do_rethrow::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\REPLMode\REPLMode.jl:381
 [25] do_cmd at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\REPLMode\REPLMode.jl:376 [inlined]
 [26] (::Pkg.REPLMode.var"#24#27"{REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\REPLMode\REPLMode.jl:542
 [27] #invokelatest#1 at .\essentials.jl:712 [inlined]
 [28] invokelatest at .\essentials.jl:711 [inlined]
 [29] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\REPL\src\LineEdit.jl:2354
 [30] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\REPL\src\REPL.jl:1055
 [31] run_repl(::REPL.AbstractREPL, ::Any) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\REPL\src\REPL.jl:206
 [32] (::Base.var"#764#766"{Bool,Bool,Bool,Bool})(::Module) at .\client.jl:383
 [33] #invokelatest#1 at .\essentials.jl:712 [inlined]
 [34] invokelatest at .\essentials.jl:711 [inlined]
 [35] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at .\client.jl:367
 [36] exec_options(::Base.JLOptions) at .\client.jl:305
 [37] _start() at .\client.jl:484

有谁知道我应该在这里做什么才能安装软件包?

4

2 回答 2

7

Windows 有时似乎在克隆注册表时遇到问题。您可以尝试删除并重C:\Users\Quinten Cabo\.julia\registries\General试,或者(也许更好)您可以简单地git clone将 Julia 之外的注册表添加到该位置。


在即将到来的 Julia 1.5 中,注册表默认不会使用 git,所以希望这个问题不应该出现。

于 2020-04-21T12:43:45.283 回答
1

我删除了 .julia\registries\General ,然后重新安装了包,它工作正常。所以它再次建立了注册表。

重建需要一点时间。有耐心。

于 2020-11-14T10:27:36.117 回答