在项目虚拟环境中添加包时出现Pkg.precompile错误(Julia)
来自 Python 背景,我现在正在尝试学习 Julia,所以我的问题可能与我在 Python 和 Julia 之间的虚拟环境之间的混淆有关。在 Julia 中,我在将包添加到项目虚拟环境中时遇到困难。但是,当我不使用项目环境(例如在 REPL 中)时,添加包没有问题:
(@v1.6) pkg>add CSV
成功添加CSV包。但是,当我激活我的项目环境(称为self_learn)并尝试将相同的包添加到此环境中时,我在 REPL 中看到以下错误消息:
(@1.6) pkg> activate .
(self_learn) pkg> st
Project self_learn v0.1.0
Status `D:DropboxJuliaself_learnProject.toml` (empty project)
(self_learn) pkg> add CSV
Resolving package versions...
Updating `D:DropboxJuliaself_learnProject.toml`
[336ed68f] + CSV v0.8.4
Updating `D:DropboxJuliaself_learnManifest.toml`
[336ed68f] + CSV v0.8.4
[9a962f9c] + DataAPI v1.6.0
[e2d170a0] + DataValueInterfaces v1.0.0
[82899510] + IteratorInterfaceExtensions v1.0.0
[69de0a69] + Parsers v1.1.0
[2dfb63ee] + PooledArrays v1.2.1
[91c51154] + SentinelArrays v1.2.16
[3783bdb8] + TableTraits v1.0.1
[bd369af6] + Tables v1.4.2
[2a0f44e3] + Base64
[ade2ca70] + Dates
[9fa8497b] + Future
[b77e0a4c] + InteractiveUtils
[8f399da3] + Libdl
[37e2e46d] + LinearAlgebra
[56ddb016] + Logging
[d6f4376e] + Markdown
[a63ad114] + Mmap
[de0858da] + Printf
[9a3f8284] + Random
[9e88b42a] + Serialization
[8dfed614] + Test
[4ec0a83e] + Unicode
Precompiling project...
Progress [> ] 0/1
? self_learn
? Error: Pkg.precompile error
? exception =
? ArgumentError: Invalid header in cache file C:UsersAdmin.juliacompiledv1.6self_learnjl_A3B4.tmp.
? Stacktrace:
? [1] preferences_hash(cachefile::String)
? @ Base .loading.jl:1478
? [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IOBuffer, internal_stdout::Base.DevNull)
? @ Base .loading.jl:1337
? [3] (::Pkg.API.var"#215#242"{IOBuffer, String, Base.PkgId})()
? @ Pkg.API C:buildbotworkerpackage_win64buildusrsharejuliastdlibv1.6PkgsrcAPI.jl:1144
? [4] with_logstate(f::Function, logstate::Any)
? @ Base.CoreLogging .logging.jl:491
? [5] with_logger
? @ .logging.jl:603 [inlined]
? [6] macro expansion
? @ C:buildbotworkerpackage_win64buildusrsharejuliastdlibv1.6PkgsrcAPI.jl:1143 [inlined]
? [7] (::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}, Dict{Base.UUID, Pkg.Types.PackageEntry}, Vector{Base.PkgId}, Bool, Base.TTY, Base.Semaphore, String, Vector{String}, Vector{Base.PkgId}, Base.PkgId})()
? self_learn
(self_learn) pkg>
添加其他包,例如DataFrames和Pipe导致相同的预编译错误。我已尝试卸载并重新安装 Julia 1.6.1,但此问题仍然存在。我正在使用 Windows 10。
任何帮助将不胜感激。
THE END
二维码