ERROR: The following package names could not be resolved: error installing package in Julia

ERROR: The following package names could not be resolved: error installing package in Julia

我正在尝试使用 pkg add 安装 julia Flux,但出现以下错误,

    julia> Pkg.add("Flux")
    ERROR: The following package names could not be resolved:
    * Flux (not found in project, manifest or registry)
    Please specify by known `name=uuid`.
   Stacktrace:
 

    [1] pkgerror(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:120
     [2] #ensure_resolved#43(::Bool, ::Function, ::Pkg.Types.EnvCache, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:900
     [3] #ensure_resolved at ./none:0 [inlined]
     [4] #add_or_develop#15(::Symbol, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:64
     [5] #add_or_develop at ./none:0 [inlined]
     [6] #add_or_develop#14 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:34 [inlined]
     [7] #add_or_develop at ./none:0 [inlined]
     [8] #add_or_develop#11 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:33 [inlined]
     [9] #add_or_develop at ./none:0 [inlined]
     [10] #add_or_develop#10 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:32 [inlined]
     [11] #add_or_develop at ./none:0 [inlined]
     [12] #add#20 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:74 [inlined]
     [13] add(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:74
     [14] top-level scope at none:0
    
  

我尝试使用 ] add https://github.com/FluxML/Flux.jl 但出现了同样的错误 谁能帮忙 我也尝试添加其他包,但发生了类似的错误,我想这可能是 julia env 的错误,但我不确定,所以我不想弄乱它

基本上,这种类型的错误要么意味着您没有互联网连接(或者位于阻止包管理器连接的防火墙后面),要么您的 .julia 文件夹已损坏。

在第二种情况下,最简单的尝试是删除 .julia 文件夹或将系统变量 JULIA_DEPOT_PATH 设置为指向某个空文件夹并重新启动 Julia。