# How to Fix Failed to Precompile Plots: Required dependency Xorg\_xcb\_util\_jll \[2def613f-5ad1-5310-b15b-b15d46f528f5\] failed to load from a cache file

**URL:** <https://discourse.julialang.org/t/how-to-fix-failed-to-precompile-plots-required-dependency-xorg-xcb-util-jll-2def613f-5ad1-5310-b15b-b15d46f528f5-failed-to-load-from-a-cache-file/98909>\
**Category:** General Usage\
**Tags:** question\
**Created:** [May 16, 2023, 5:16am UTC](https://discourse.julialang.org/t/how-to-fix-failed-to-precompile-plots-required-dependency-xorg-xcb-util-jll-2def613f-5ad1-5310-b15b-b15d46f528f5-failed-to-load-from-a-cache-file/98909 "2023-05-16T05:16:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [May 16, 2023, 5:16am UTC](https://discourse.julialang.org/t/how-to-fix-failed-to-precompile-plots-required-dependency-xorg-xcb-util-jll-2def613f-5ad1-5310-b15b-b15d46f528f5-failed-to-load-from-a-cache-file/98909/1 "2023-05-16T05:16:16Z")

</div>

I add `FresnelIntegrals` yesterday and then suddenly Plots can’t be compiled. (can’t believe this FresnelIntegrals package can cause so many damages)

I tried this but still not working:

> [@Plots and GR\_jll is not working and fails to precompile](https://discourse.julialang.org/t/plots-and-gr-jll-is-not-working-and-fails-to-precompile/89657/3):
>
> Hello It did not work. Please see below. CODE I updated the code as follows: "import Pkg; Pkg.add(“Plots”); Pkg.add(“GR\_jll”); using GR\_jll; using Plots; Pkg.status() f(x) = sin(x); plot(f,0,2\*pi,title=“First Graph”,xlabe = “x”, ylabel = “y”); g(x) = cos(x); list of two functions f and g included in the plot plot([f,g],0,2\*pi,title=“First Graph”,xlabe = “x”, ylabel = “y”); savefig(“firstgraph.pdf”);" ERROR MESSAGE The error message is as follows: " Updating registry at C:\User…

> <https://stackoverflow.com/questions/66314494/gr-jll-keeps-failing-to-precompile-where-using-julia-1-6-0-rc1-on-windows>

ERROR: The following 1 direct dependency failed to precompile:

Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]

Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to /home/browni/.julia/compiled/v1.7/Plots/jl\_SfXygZ.  
┌ Warning: The call to compilecache failed to create a usable precompiled cache file for GR\_jll [d2c73de3-f751-5644-a686-071e5b155ba9]  
│ exception = Required dependency Xorg\_xcb\_util\_jll [2def613f-5ad1-5310-b15b-b15d46f528f5] failed to load from a cache file.  
└ @ Base loading.jl:1132  
┌ Warning: The call to compilecache failed to create a usable precompiled cache file for GR [28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71]  
│ exception = Required dependency Xorg\_xcb\_util\_jll [2def613f-5ad1-5310-b15b-b15d46f528f5] failed to load from a cache file.  
└ @ Base loading.jl:1132  
┌ Warning: The call to compilecache failed to create a usable precompiled cache file for GR\_jll [d2c73de3-f751-5644-a686-071e5b155ba9]  
│ exception = Required dependency Xorg\_xcb\_util\_jll [2def613f-5ad1-5310-b15b-b15d46f528f5] failed to load from a cache file.  
└ @ Base loading.jl:1132  
ERROR: LoadError: UndefRefError: access to undefined reference

 ![Capture d’écran_2023-05-16_12-23-36](https://global.discourse-cdn.com/julialang/original/3X/5/d/5def82e5e2b19e0b0c8755756df1684e5382cd1b.png)

ERROR: Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to /home/browni/.julia/compiled/v1.7/Plots/jl\_lbJMMi.  
Stacktrace:  
[1] error(s::String)  
@ Base ./error.jl:33  
[2] compilecache(pkg::Base.PkgId, path::String, internal\_stderr::IO, internal\_stdout::IO, ignore\_loaded\_modules::Bool)  
@ Base ./loading.jl:1466  
[3] compilecache(pkg::Base.PkgId, path::String)  
@ Base ./loading.jl:1410

 ![Capture d’écran_2023-05-16_12-38-53](https://global.discourse-cdn.com/julialang/original/3X/d/c/dc5d9397dfc8fc622a0612f298d05f27e6191a55.png)

I tried a lot of things still not working.

I am thinking on deleting the whole `.julia` it took 32 GB after 1 year of usage. Hopefully new / fresh Julia won’t have Plots precompiling problem.

 ![Capture d’écran_2023-05-16_12-40-04](https://global.discourse-cdn.com/julialang/original/3X/8/4/843884816bb39b16f01081e48b42242710c30cd6.png)

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [May 16, 2023, 6:06am UTC](https://discourse.julialang.org/t/how-to-fix-failed-to-precompile-plots-required-dependency-xorg-xcb-util-jll-2def613f-5ad1-5310-b15b-b15d46f528f5-failed-to-load-from-a-cache-file/98909/2 "2023-05-16T06:06:03Z")

</div>

Firstly, make sure to work with projects and install only the packages you need for a project locally, e.g.

```julia
mkdir myproject
cd myproject
julia --project="."

```

and then

```julia
using Pkg
Pkg.add("Plots")

```

In this way you can avoid that dependencies of Plots get downgraded because you installed an autdated package somewhere for testing.

If the precompilation still fails you can also delete the folder:  
.julia/compiled/v1.9/Plots

(replace v1.9 with the version you are using)

and try to install Plots again.

Does this help?

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [May 16, 2023, 6:19am UTC](https://discourse.julialang.org/t/how-to-fix-failed-to-precompile-plots-required-dependency-xorg-xcb-util-jll-2def613f-5ad1-5310-b15b-b15d46f528f5-failed-to-load-from-a-cache-file/98909/3 "2023-05-16T06:19:43Z")

</div>

I already delete the whole `.julia` but next time I will use your advice, thanks.

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [May 16, 2023, 9:05am UTC](https://discourse.julialang.org/t/how-to-fix-failed-to-precompile-plots-required-dependency-xorg-xcb-util-jll-2def613f-5ad1-5310-b15b-b15d46f528f5-failed-to-load-from-a-cache-file/98909/4 "2023-05-16T09:05:52Z")

</div>

It might be useful for anyone using Linux and want to start Julia from fresh, starting with Plots precompiling problem. Especially later on for adding SymPy (for Calculus learning) with Conda and PyCall. Spend my afternoon for figuring out this again (refreshing memory how I did it months ago)

1. Delete the whole `.julia` folder
2. Replacing the old Julia with newer Julia (1.9.0) → make sure you edit the ~/.bashrc and adjust the path to new Julia. To make sure the path is correct check by open xterm / terminal and type:

```julia
vim ~/.bashrc

```

edit by typing `i` and then after finish press Esc and type `:wq` to save, or  
`!q` to leave without saving

in terminal go to designated folder to test Julia:

```julia
cd ../Test/
julia --project="."

```

```julia
julia> ] 
Pkg> add Conda

julia> using Conda
julia> Conda.update()

```

go to terminal again and type

```julia
source /home/browni/.julia/conda/3/x86_64/bin/activate 
(adjust with your own path it should not be /home/browni at first)
conda create -y -p /home/browni/.julia/conda/3/x86_64/envs/lasthrimprojection
conda activate /home/browni/.julia/conda/3/x86_64/envs/lasthrimprojection/

conda install -y matplotlib
conda install -y pandas
conda install -y numpy
conda install -y scipy
conda install -y sympy

```

then go to the directory designated to test Julia and type in terminal / xterm:

```julia
julia --project="."

```

```julia
Pkg> add PyCall

julia> using PyCall

(if you get failed to Precompile PyCall)
julia> using Pkg
julia> Pkg.build("PyCall")

(to change the python that is used by PyCall)

julia> ENV["PYTHON"]="/home/browni/.julia/conda/3/x86_64/envs/lasthrimprojection/bin/python3"
julia> using Pkg
julia> Pkg.build("PyCall")

(to add SymPy)
julia> Conda.add("SymPy", "/home/browni/.julia/conda/3/x86_64/envs/lasthrimprojection")

julia> add SymPy
julia> using SymPy

```

with new Julia 1.9.0 (from 1.7.3), installing packages Conda with SymPy, then Plots and CairoMakie, then FresnelIntegrals and friends, after deleting 32 GB now I have 7.8 GB… all that static libraries and headers .

![5](https://global.discourse-cdn.com/julialang/original/3X/0/5/052b71c005fc406a4664504ceec68d3bacf61eb5.png)

 ![Capture d’écran_2023-05-16_16-08-52](https://global.discourse-cdn.com/julialang/original/3X/e/c/ec5af69595155fc23c579d49645ed198ea8619b7.png)
