Julia中ExcelFiles、Plots与JuMP包预编译失败求助
Hey there, sorry to hear you're stuck with this precompile error while setting up JuMP—let's work through some practical fixes to get you back on track:
Clear corrupted precompile caches
Leftover broken cache files are a common culprit here. First, remove JuMP entirely and run Julia's garbage collector to wipe residual files:using Pkg Pkg.rm("JuMP") Pkg.gc()Restart Julia after this, then try reinstalling JuMP with
Pkg.add("JuMP")again.Confirm Julia version compatibility
JuMP has specific version requirements for Julia. Since you're on v1.7, try installing a explicitly compatible version of JuMP to avoid mismatches:Pkg.add(name="JuMP", version="1.10")(Version 1.10 is verified to work smoothly with Julia 1.7—adjust if you need a newer release that still supports your Julia version.)
Test in a clean temporary environment
Conflicts with other packages like ExcelFiles or Plots might be causing the failure. Create an isolated temporary environment to test JuMP installation alone:using Pkg Pkg.activate("--temp") Pkg.add("JuMP") using JuMPIf this works, the issue lies with your main environment's dependencies. You can then gradually add other packages to the temp environment to pinpoint which one is conflicting.
Get detailed precompile error logs
The generic error message doesn't show the root cause. Run a verbose precompile to see exactly what's breaking:using Pkg Pkg.precompile("JuMP"; verbose=true)Look for specific error lines (like missing sub-dependencies or syntax issues in a related package) to target your fix more precisely.
Check system write permissions
The error references writing toC:\Users\yobbi\.julia\compiled\v1.7\JuMP. If Julia doesn't have proper write access to this folder, precompile will fail. Try launching Julia as an administrator, then repeat the installation steps.
内容的提问来源于stack exchange,提问作者Yasmin Obbink

