安装CSV.jl时,出现了未知错误

我在重装安装CSV.jl时,突然出现了以下错误。一个月前安装各类包并没有出现该错误。有了解的朋友麻烦帮忙看看应该如何处理。非常感谢。


(@v1.6) pkg> add CSV
    Updating registry at `D:\ProgrammingLanguage\Julia\Package\registries\General`
   Resolving package versions...
     Cloning [91c51154-3ec4-41a3-a24f-3f23e20d615c] SentinelArrays from https://github.com/JuliaData/SentinelArrays.jl.git
   Installed SentinelArrays ─ v1.3.8
    Updating `D:\ProgrammingLanguage\Julia\Package\environments\v1.6\Project.toml`
  [336ed68f] + CSV v0.8.5
    Updating `D:\ProgrammingLanguage\Julia\Package\environments\v1.6\Manifest.toml`
  [336ed68f] + CSV v0.8.5
  [91c51154] + SentinelArrays v1.3.8
Precompiling project...
  ◑ SentinelArrays
  ◑ GLFW_jll
┌ Error: Pkg.precompile error
│   exception =
│    IOError: chmod("D:\\ProgrammingLanguage\\Julia\\Package\\compiled\\v1.6\\SentinelArrays\\uMYVe_lKus0.ji", 0o777): unknown error (UNKNOWN)
│    Stacktrace:
│      [1] uv_error
│        @ .\libuv.jl:97 [inlined]
│      [2] chmod(path::String, mode::UInt16; recursive::Bool)
│        @ Base.Filesystem .\file.jl:1090
│      [3] chmod
│        @ .\file.jl:1089 [inlined]
│      [4] rm(path::String; force::Bool, recursive::Bool)
│        @ Base.Filesystem .\file.jl:269
│      [5] checkfor_mv_cp_cptree(src::String, dst::String, txt::String; force::Bool)
│        @ Base.Filesystem .\file.jl:310
│      [6] cp(src::String, dst::String; force::Bool, follow_symlinks::Bool)
│        @ Base.Filesystem .\file.jl:349
│      [7] rename(src::String, dst::String; force::Bool)
│        @ Base.Filesystem .\file.jl:943
│      [8] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IOBuffer, internal_stdout::Base.DevNull, ignore_loaded_modules::Bool)
│        @ Base .\loading.jl:1376
│      [9] (::Pkg.API.var"#215#242"{IOBuffer, String, Base.PkgId})()
│        @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:1152
│     [10] with_logstate(f::Function, logstate::Any)
│        @ Base.CoreLogging .\logging.jl:491
│     [11] with_logger
│        @ .\logging.jl:603 [inlined]
│     [12] macro expansion
│        @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:1149 [inlined]
│     [13] (::Pkg.API.var"#212#239"{Bool, Vector{Task}, Pkg.API.var"#handle_interrupt#231"{Base.Event, ReentrantLock, Base.TTY}, Pkg.API.var"#color_string#229", Base.Event, Base.Event, ReentrantLock, Vector{Base.PkgId}, Vector{Base.PkgId}, Dict{Base.PkgId, String}, Vector{Base.PkgId}, Vector{Base.PkgId}, Dict{Base.PkgId, Bool}, Dict{Base.PkgId, Base.Event}, Dict{Base.PkgId, Bool}, Pkg.Types.Manifest, Vector{Base.PkgId}, Bool, Base.TTY, Base.Semaphore, String, Vector{String}, Vector{Base.PkgId}, Base.PkgId})()
│        @ Pkg.API .\task.jl:411
└ @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:1023

附上Julia的版本


julia> using InteractiveUtils; versioninfo()
Julia Version 1.6.2
Commit 1b93d53fc4 (2021-07-14 15:36 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: AMD Ryzen 7 5800U with Radeon Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, generic)
Environment:
  JULIA_DEPOT_PATH = D:\ProgrammingLanguage\Julia\Package

而且奇怪的是,会显示CSV包已经安装。但实际并不能用。


julia> Pkg.status()
      Status `D:\ProgrammingLanguage\Julia\Package\environments\v1.6\Project.toml`
  [6e4b80f9] BenchmarkTools v1.1.3
  [336ed68f] CSV v0.8.5
  [a93c6f00] DataFrames v1.2.2
  [652e05fd] JuliaZH v1.5.4
  [91a5bcdd] Plots v1.20.1
  [8bb1440f] DelimitedFiles

julia> using CSV
[ Info: Precompiling CSV [336ed68f-0bac-5ca0-87d4-7b16caf5d00b]
ERROR: LoadError: IOError: chmod("D:\\ProgrammingLanguage\\Julia\\Package\\compiled\\v1.6\\SentinelArrays\\uMYVe_lKus0.ji", 0o777): unknown error (UNKNOWN)
Stacktrace:
  [1] uv_error
    @ .\libuv.jl:97 [inlined]
  [2] chmod(path::String, mode::UInt16; recursive::Bool)
    @ Base.Filesystem .\file.jl:1090
  [3] chmod
    @ .\file.jl:1089 [inlined]
  [4] rm(path::String; force::Bool, recursive::Bool)
    @ Base.Filesystem .\file.jl:269
  [5] checkfor_mv_cp_cptree(src::String, dst::String, txt::String; force::Bool)
    @ Base.Filesystem .\file.jl:310
  [6] cp(src::String, dst::String; force::Bool, follow_symlinks::Bool)
    @ Base.Filesystem .\file.jl:349
  [7] rename(src::String, dst::String; force::Bool)
    @ Base.Filesystem .\file.jl:943
  [8] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY, ignore_loaded_modules::Bool)
    @ Base .\loading.jl:1376
  [9] compilecache(pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1329
 [10] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1043
 [11] require(uuidkey::Base.PkgId)
    @ Base .\loading.jl:936
 [12] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:923
 [13] include
    @ .\Base.jl:386 [inlined]
 [14] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base .\loading.jl:1235
 [15] top-level scope
    @ none:1
 [16] eval
    @ .\boot.jl:360 [inlined]
 [17] eval(x::Expr)
    @ Base.MainInclude .\client.jl:446
 [18] top-level scope
    @ none:1
in expression starting at D:\ProgrammingLanguage\Julia\Package\packages\CSV\Zl2ww\src\CSV.jl:1
ERROR: Failed to precompile CSV [336ed68f-0bac-5ca0-87d4-7b16caf5d00b] to D:\ProgrammingLanguage\Julia\Package\compiled\v1.6\CSV\jl_3EF0.tmp.
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY, ignore_loaded_modules::Bool)
   @ Base .\loading.jl:1385
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base .\loading.jl:1329
 [4] _require(pkg::Base.PkgId)
   @ Base .\loading.jl:1043
 [5] require(uuidkey::Base.PkgId)
   @ Base .\loading.jl:936
 [6] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:923

删了 CSV 包,再重新安装呢?

]rm CSV
gc
add CSV

首先感谢您帮忙格式化代码,之前忘记了,实在不好意思。
我按照您提供的方重新试了一下,但是依旧不行。

(@v1.6) pkg> rm CSV
    Updating `D:\ProgrammingLanguage\Julia\Package\environments\v1.6\Project.toml`
  [336ed68f] - CSV v0.8.5
    Updating `D:\ProgrammingLanguage\Julia\Package\environments\v1.6\Manifest.toml`
  [336ed68f] - CSV v0.8.5
  [91c51154] - SentinelArrays v1.3.8

(@v1.6) pkg> gc
      Active manifest files: 1 found
      Active artifact files: 64 found
      Active scratchspaces: 1 found
     Deleted no artifacts, repos, packages or scratchspaces

(@v1.6) pkg> add CSV
    Updating registry at `D:\ProgrammingLanguage\Julia\Package\registries\General`
   Resolving package versions...
    Updating `D:\ProgrammingLanguage\Julia\Package\environments\v1.6\Project.toml`
  [336ed68f] + CSV v0.8.5
    Updating `D:\ProgrammingLanguage\Julia\Package\environments\v1.6\Manifest.toml`
  [336ed68f] + CSV v0.8.5
  ◓ SentinelArrays
┌ Error: Pkg.precompile error
│   exception =                                      ]  0/16
│    IOError: chmod("D:\\ProgrammingLanguage\\Julia\\Package\\compiled\\v1.6\\SentinelArrays\\uMYVe_lKus0.ji", 0o777): unknown error (UNKNOWN)
│    Stacktrace:
│      [1] uv_error
│        @ .\libuv.jl:97 [inlined]
│      [2] chmod(path::String, mode::UInt16; recursive::Bool)
│        @ Base.Filesystem .\file.jl:1090
│      [3] chmod
│        @ .\file.jl:1089 [inlined]
│      [4] rm(path::String; force::Bool, recursive::Bool)
│        @ Base.Filesystem .\file.jl:269
│      [5] checkfor_mv_cp_cptree(src::String, dst::String, txt::String; force::Bool)
│        @ Base.Filesystem .\file.jl:310
│      [6] cp(src::String, dst::String; force::Bool, follow_symlinks::Bool)
│        @ Base.Filesystem .\file.jl:349
│      [7] rename(src::String, dst::String; force::Bool)
│        @ Base.Filesystem .\file.jl:943
│      [8] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IOBuffer, internal_stdout::Base.DevNull, ignore_loaded_modules::Bool)
│        @ Base .\loading.jl:1376
│      [9] (::Pkg.API.var"#215#242"{IOBuffer, String, Base.PkgId})()
│        @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:1152
│     [10] with_logstate(f::Function, logstate::Any)
│        @ Base.CoreLogging .\logging.jl:491
│     [11] with_logger
│        @ .\logging.jl:603 [inlined]
│     [12] macro expansion
│        @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:1149 [inlined]
│     [13] (::Pkg.API.var"#212#239"{Bool, Vector{Task}, Pkg.API.var"#handle_interrupt#231"{Base.Event, ReentrantLock, Base.TTY}, Pkg.API.var"#color_string#229", Base.Event, Base.Event, ReentrantLock, Vector{Base.PkgId}, Vector{Base.PkgId}, Dict{Base.PkgId, String}, Vector{Base.PkgId}, Vector{Base.PkgId}, Dict{Base.PkgId, Bool}, Dict{Base.PkgId, Base.Event}, Dict{Base.PkgId, Bool}, Pkg.Types.Manifest, Vector{Base.PkgId}, Bool, Base.TTY, Base.Semaphore, String, Vector{String}, Vector{Base.PkgId}, Base.PkgId})()
│        @ Pkg.API .\task.jl:411
└ @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:1023

看起来是没有完全修复的 issue

看上去有可以绕过的办法:

哪个文件权限出错,就把他所在的文件夹删掉。然后重新安装/预编译 CSV 包。

对于这个报错是删掉:
D:\ProgrammingLanguage\Julia\Package\compiled\v1.6\SentinelArrays\