Artifacts folder not empty - error when installing Plots.jl

Hi,
Iโ€™m getting the same error for different packages in Julia. For example, when I try to install Plots, I get the error.

IOError: rm("C:\\Users\\___\\.julia\\artifacts\\jl_6eeUjb\\bin"): directory not empty (ENOTEMPTY)
Stacktrace:
  [1] uv_error
    @ .\libuv.jl:106 [inlined]
  [2] rm(path::String; force::Bool, recursive::Bool)
    @ Base.Filesystem .\file.jl:307
  [3] rm(path::String; force::Bool, recursive::Bool)
    @ Base.Filesystem .\file.jl:294
  [4] rm
    @ .\file.jl:273 [inlined]
  [5] download_artifact(tree_hash::Base.SHA1, tarball_url::String, tarball_hash::Nothing; verbose::Bool, quiet_download::Bool, io::IOContext{IO})

Iโ€™m also getting this error when I try to install GeometryBasics for a different artifact. Iโ€™ve already tried reinstalling Julia and removing the artifacts folder, but the error still occurred with Julia versions 1.10.4 and 1.11 rc. I am working on windows 11.
Iโ€™d really appreciate any help.

It seems like your anti-virus is interfering with Julia saving files.

I made a PR to improve the error message here:

Any feedback on the PR would be appreciated.

As a work around you can try using a different anti-virus, or install the packages with julia 1.9 and then use julia 1.10

If you want to test out Better error messages if artifact rename fails by nhz2 ยท Pull Request #3827 ยท JuliaLang/Pkg.jl ยท GitHub

Here are the steps.

  1. Clone my fork of Pkg.jl:
git clone https://github.com/nhz2/Pkg.jl.git
cd Pkg.jl
git checkout nz/better-errors
  1. Start julia 1.11 in the Pkg.jl directory:
julia +1.11 --project --startup-file=no
  1. In julia run:
import Pkg
Pkg.pkg"activate --temp"
Pkg.pkg"add Plots"

Please let me know what the error message looks like with this PR.

Got it working now. Had to run include(โ€œsrc/Pkg.jlโ€) before.

You where right. The error:

>  Error: your anti-virus may be interfering with artifact installation
> โ”‚ See https://github.com/JuliaLang/Pkg.jl/issues/3822
> โ”” @ Main.Pkg.Artifacts C:\Users\sellmann\Promotion\Programming\Julia\Projects\Package_tests\Pkg.jl\src\Artifacts.jl:81
> โ”Œ Error: your anti-virus may be interfering with artifact installation
> โ”‚ See https://github.com/JuliaLang/Pkg.jl/issues/3822

Thanks for testing this. Is there more info from the error, like a section on what artifact failed to install, or a stack trace? The error you pasted seems to be cut off.

julia> Pkg.pkg"add Plots"
   Resolving package versions...
   Installed Statistics โ”€ v1.11.1
โ”Œ Error: your anti-virus may be interfering with artifact installation
โ”‚ See https://github.com/JuliaLang/Pkg.jl/issues/3822
โ”” @ Main.Pkg.Artifacts C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\Artifacts.jl:81
โ”Œ Warning: Failed to clean up temporary directory "C:\\Users\\ores.ousoultzoglou\\.julia\\artifacts\\jl_fukAt4"
โ”‚   exception = IOError: rm("C:\\Users\\ores.ousoultzoglou\\.julia\\artifacts\\jl_fukAt4\\bin"): directory not empty (ENOTEMPTY)
โ”” @ Main.Pkg.Artifacts C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\Artifacts.jl:386
โ”Œ Error: your anti-virus may be interfering with artifact installation
โ”‚ See https://github.com/JuliaLang/Pkg.jl/issues/3822
โ”” @ Main.Pkg.Artifacts C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\Artifacts.jl:81
โ”Œ Warning: Failed to clean up temporary directory "C:\\Users\\ores.ousoultzoglou\\.julia\\artifacts\\jl_nEUv5J"
โ”‚   exception = IOError: rm("C:\\Users\\ores.ousoultzoglou\\.julia\\artifacts\\jl_nEUv5J\\bin"): directory not empty (ENOTEMPTY)
โ”” @ Main.Pkg.Artifacts C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\Artifacts.jl:386
ERROR: Unable to automatically download/install artifact 'fzf' from sources listed in 'C:\Users\ores.ousoultzoglou\.julia\packages\fzf_jll\okrgy\Artifacts.toml'.
Sources attempted:
- https://pkg.julialang.org/artifact/8043c72c48288c74e7f13c0c4aecbd239ef872bb
    Error: IOError: rename of "C:\\Users\\ores.ousoultzoglou\\.julia\\artifacts\\jl_fukAt4" to "C:\\Users\\ores.ousoultzoglou\\.julia\\artifacts\\8043c72c48288c74e7f13c0c4aecbd239ef872bb": permission denied (EACCES)
- https://github.com/JuliaBinaryWrappers/fzf_jll.jl/releases/download/fzf-v0.43.0+0/fzf.v0.43.0.x86_64-w64-mingw32.tar.gz
    Error: IOError: rename of "C:\\Users\\ores.ousoultzoglou\\.julia\\artifacts\\jl_nEUv5J" to "C:\\Users\\ores.ousoultzoglou\\.julia\\artifacts\\8043c72c48288c74e7f13c0c4aecbd239ef872bb": permission denied (EACCES)

Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] ensure_artifact_installed(name::String, meta::Dict{โ€ฆ}, artifacts_toml::String; platform::Base.BinaryPlatforms.Platform, verbose::Bool, quiet_download::Bool, io::Main.Pkg.UnstableIO)
    @ Main.Pkg.Artifacts C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\Artifacts.jl:478
  [3]
    @ Main.Pkg.Operations C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\Operations.jl:770
  [4] add(ctx::Main.Pkg.Types.Context, pkgs::Vector{โ€ฆ}, new_git::Set{โ€ฆ}; preserve::Main.Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, target::Symbol)
    @ Main.Pkg.Operations C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\Operations.jl:1433
  [5] add
    @ C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\Operations.jl:1399 [inlined]
  [6] add(ctx::Main.Pkg.Types.Context, pkgs::Vector{โ€ฆ}; preserve::Main.Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, target::Symbol, kwargs::@Kwargs{โ€ฆ})
    @ Main.Pkg.API C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\API.jl:307
  [7] add(pkgs::Vector{Main.Pkg.Types.PackageSpec}; io::Main.Pkg.UnstableIO, kwargs::@Kwargs{})
    @ Main.Pkg.API C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\API.jl:160
  [8] add(pkgs::Vector{Main.Pkg.Types.PackageSpec})
    @ Main.Pkg.API C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\API.jl:149
  [9] do_cmd(command::Main.Pkg.REPLMode.Command, io::Main.Pkg.UnstableIO)
    @ Main.Pkg.REPLMode C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\REPLMode\REPLMode.jl:407
 [10] do_cmds(commands::Vector{Main.Pkg.REPLMode.Command}, io::Main.Pkg.UnstableIO)
    @ Main.Pkg.REPLMode C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\REPLMode\REPLMode.jl:393
 [11] do_cmds(input::String, io::Main.Pkg.UnstableIO)
    @ Main.Pkg.REPLMode C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\REPLMode\REPLMode.jl:383
 [12] pkgstr(str::String)
    @ Main.Pkg.REPLMode C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\REPLMode\REPLMode.jl:450
 [13] top-level scope
    @ REPL[4]:1
Some type information was truncated. Use `show(err)` to see complete types.

julia> show(err)
1-element ExceptionStack:
Unable to automatically download/install artifact 'fzf' from sources listed in 'C:\Users\ores.ousoultzoglou\.julia\packages\fzf_jll\okrgy\Artifacts.toml'.
Sources attempted:
- https://pkg.julialang.org/artifact/8043c72c48288c74e7f13c0c4aecbd239ef872bb
    Error: IOError: rename of "C:\\Users\\ores.ousoultzoglou\\.julia\\artifacts\\jl_fukAt4" to "C:\\Users\\ores.ousoultzoglou\\.julia\\artifacts\\8043c72c48288c74e7f13c0c4aecbd239ef872bb": permission denied (EACCES)
- https://github.com/JuliaBinaryWrappers/fzf_jll.jl/releases/download/fzf-v0.43.0+0/fzf.v0.43.0.x86_64-w64-mingw32.tar.gz
    Error: IOError: rename of "C:\\Users\\ores.ousoultzoglou\\.julia\\artifacts\\jl_nEUv5J" to "C:\\Users\\ores.ousoultzoglou\\.julia\\artifacts\\8043c72c48288c74e7f13c0c4aecbd239ef872bb": permission denied (EACCES)

Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] ensure_artifact_installed(name::String, meta::Dict{String, Any}, artifacts_toml::String; platform::Base.BinaryPlatforms.Platform, verbose::Bool, quiet_download::Bool, io::Main.Pkg.UnstableIO)
    @ Main.Pkg.Artifacts C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\Artifacts.jl:478
  [3] download_artifacts(env::Main.Pkg.Types.EnvCache; platform::Base.BinaryPlatforms.Platform, julia_version::VersionNumber, verbose::Bool, io::Main.Pkg.UnstableIO)
    @ Main.Pkg.Operations C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\Operations.jl:770
  [4] add(ctx::Main.Pkg.Types.Context, pkgs::Vector{Main.Pkg.Types.PackageSpec}, new_git::Set{Base.UUID}; preserve::Main.Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, target::Symbol)
    @ Main.Pkg.Operations C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\Operations.jl:1433
  [5] add
    @ C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\Operations.jl:1399 [inlined]
  [6] add(ctx::Main.Pkg.Types.Context, pkgs::Vector{Main.Pkg.Types.PackageSpec}; preserve::Main.Pkg.Types.PreserveLevel,
 platform::Base.BinaryPlatforms.Platform, target::Symbol, kwargs::@Kwargs{io::Main.Pkg.UnstableIO})
    @ Main.Pkg.API C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\API.jl:307
  [7] add(pkgs::Vector{Main.Pkg.Types.PackageSpec}; io::Main.Pkg.UnstableIO, kwargs::@Kwargs{})
    @ Main.Pkg.API C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\API.jl:160
  [8] add(pkgs::Vector{Main.Pkg.Types.PackageSpec})
    @ Main.Pkg.API C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\API.jl:149
  [9] do_cmd(command::Main.Pkg.REPLMode.Command, io::Main.Pkg.UnstableIO)
    @ Main.Pkg.REPLMode C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\REPLMode\REPLMode.jl:407
 [10] do_cmds(commands::Vector{Main.Pkg.REPLMode.Command}, io::Main.Pkg.UnstableIO)
    @ Main.Pkg.REPLMode C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\REPLMode\REPLMode.jl:393
 [11] do_cmds(input::String, io::Main.Pkg.UnstableIO)
    @ Main.Pkg.REPLMode C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\REPLMode\REPLMode.jl:383
 [12] pkgstr(str::String)
    @ Main.Pkg.REPLMode C:\Users\ores.ousoultzoglou\GitHub\Pkg.jl\src\REPLMode\REPLMode.jl:450
 [13] top-level scope
    @ REPL[4]:1
1 Like