# ERROR: IOError: rm("C:\\\\Users\\\\35879\\\\.julia\\\\artifacts\\\\jl\_weK1vY\\\\bin"): directory not empty (ENOTEMPTY)

**URL:** <https://discourse.julialang.org/t/error-ioerror-rm-c-users-35879-julia-artifacts-jl-wek1vy-bin-directory-not-empty-enotempty/123142>\
**Category:** New to Julia\
**Tags:** question, package\
**Created:** [November 27, 2024, 3:41am UTC](https://discourse.julialang.org/t/error-ioerror-rm-c-users-35879-julia-artifacts-jl-wek1vy-bin-directory-not-empty-enotempty/123142 "2024-11-27T03:41:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Y1123929](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/y1123929/32/213711_2.png) [@Y1123929](https://discourse.julialang.org/u/Y1123929)\
**Post date:** [November 27, 2024, 3:41am UTC](https://discourse.julialang.org/t/error-ioerror-rm-c-users-35879-julia-artifacts-jl-wek1vy-bin-directory-not-empty-enotempty/123142/1 "2024-11-27T03:41:25Z")

</div>

When I encountered this error while downloading the environment package, but the directory is empty.How should I handle it? I would be very grateful.

```julia
(ANN) pkg> add Flux, Images, Plots
   Resolving package versions...
     Failure artifact: Ghostscript
ERROR: IOError: rm("C:\\Users\\35879\\.julia\\artifacts\\jl_weK1vY\\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}) 
    @ Pkg.Artifacts D:\vs code\Julia-1.11.1\share\julia\stdlib\v1.11\Pkg\src\Artifacts.jl:376
  [6] download_artifact (repeats 2 times)
    @ D:\vs code\Julia-1.11.1\share\julia\stdlib\v1.11\Pkg\src\Artifacts.jl:297 [inlined]
  [7] #22
    @ D:\vs code\Julia-1.11.1\share\julia\stdlib\v1.11\Pkg\src\Artifacts.jl:423 [inlined]
  [8] with_show_download_info(f::Pkg.Artifacts.var"#22#24"{Bool, Bool, IOContext{IO}, Base.SHA1, String}, io::IOContext{IO}, name::String, quiet_download::Bool)
    @ Pkg.Artifacts D:\vs code\Julia-1.11.1\share\julia\stdlib\v1.11\Pkg\src\Artifacts.jl:481
  [9] ensure_artifact_installed(name::String, meta::Dict{String, Any}, artifacts_toml::String; platform::Base.BinaryPlatforms.Platform, verbose::Bool, quiet_download::Bool, io::IOContext{IO})
    @ Pkg.Artifacts D:\vs code\Julia-1.11.1\share\julia\stdlib\v1.11\Pkg\src\Artifacts.jl:422
 [10] download_artifacts(env::Pkg.Types.EnvCache; platform::Base.BinaryPlatforms.Platform, julia_version::VersionNumber, verbose::Bool, io::IOContext{IO})
    @ Pkg.Operations D:\vs code\Julia-1.11.1\share\julia\stdlib\v1.11\Pkg\src\Operations.jl:771
 [11] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Set{Base.UUID}; allow_autoprecomp::Bool, preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, target::Symbol)
    @ Pkg.Operations D:\vs code\Julia-1.11.1\share\julia\stdlib\v1.11\Pkg\src\Operations.jl:1435
 [12] add
    @ D:\vs code\Julia-1.11.1\share\julia\stdlib\v1.11\Pkg\src\Operations.jl:1400 [inlined]
 [13] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform,
 target::Symbol, allow_autoprecomp::Bool, kwargs::@Kwargs{io::IOContext{IO}})
    @ Pkg.API D:\vs code\Julia-1.11.1\share\julia\stdlib\v1.11\Pkg\src\API.jl:306
 [14] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::IOContext{IO}, kwargs::@Kwargs{})
    @ Pkg.API D:\vs code\Julia-1.11.1\share\julia\stdlib\v1.11\Pkg\src\API.jl:159
 [15] add(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API D:\vs code\Julia-1.11.1\share\julia\stdlib\v1.11\Pkg\src\API.jl:148
 [16] do_cmd(command::Pkg.REPLMode.Command, io::Base.TTY)
    @ Pkg.REPLMode D:\vs code\Julia-1.11.1\share\julia\stdlib\v1.11\Pkg\src\REPLMode\REPLMode.jl:407
 [17] do_cmds(commands::Vector{Pkg.REPLMode.Command}, io::Base.TTY)
    @ Pkg.REPLMode D:\vs code\Julia-1.11.1\share\julia\stdlib\v1.11\Pkg\src\REPLMode\REPLMode.jl:393
 [18] do_cmds(repl::REPL.LineEditREPL, commands::String)
    @ REPLExt D:\vs code\Julia-1.11.1\share\julia\stdlib\v1.11\Pkg\ext\REPLExt\REPLExt.jl:92
 [19] on_done(s::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool, repl::REPL.LineEditREPL)
    @ REPLExt D:\vs code\Julia-1.11.1\share\julia\stdlib\v1.11\Pkg\ext\REPLExt\REPLExt.jl:106
 [20] #invokelatest#2
    @ .\essentials.jl:1055 [inlined]
 [21] invokelatest
    @ .\essentials.jl:1052 [inlined]
 [22] (::REPLExt.var"#47#50"{REPL.LineEditREPL})(s::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool)
    @ REPLExt D:\vs code\Julia-1.11.1\share\julia\stdlib\v1.11\Pkg\ext\REPLExt\REPLExt.jl:128
 [23] #invokelatest#2
    @ .\essentials.jl:1055 [inlined]
 [24] invokelatest
    @ .\essentials.jl:1052 [inlined]
 [25] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit D:\vs code\Julia-1.11.1\share\julia\stdlib\v1.11\REPL\src\LineEdit.jl:2755
 [26] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL D:\vs code\Julia-1.11.1\share\julia\stdlib\v1.11\REPL\src\REPL.jl:1471
 [27] (::REPL.var"#75#81"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL D:\vs code\Julia-1.11.1\share\julia\stdlib\v1.11\REPL\src\REPL.jl:480

```

---

<div class="post-metadata">

**Author:** ![nhz2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nhz2/32/44428_2.png) [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Post date:** [November 27, 2024, 4:43am UTC](https://discourse.julialang.org/t/error-ioerror-rm-c-users-35879-julia-artifacts-jl-wek1vy-bin-directory-not-empty-enotempty/123142/2 "2024-11-27T04:43:33Z")

</div>

Is julia nightly able to download Ghostscript? If you have juliaup you can use `juliaup add nightly`, otherwise you can download julia nightly from [Julia Downloads (nightly binaries)](https://julialang.org/downloads/nightlies/)

---

<div class="post-metadata">

**Author:** ![Y1123929](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/y1123929/32/213711_2.png) [@Y1123929](https://discourse.julialang.org/u/Y1123929)\
**Post date:** [November 27, 2024, 9:57am UTC](https://discourse.julialang.org/t/error-ioerror-rm-c-users-35879-julia-artifacts-jl-wek1vy-bin-directory-not-empty-enotempty/123142/3 "2024-11-27T09:57:29Z")

</div>

ok，thank you！

---

<div class="post-metadata">

**Author:** ![nhz2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nhz2/32/44428_2.png) [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Post date:** [November 27, 2024, 6:17pm UTC](https://discourse.julialang.org/t/error-ioerror-rm-c-users-35879-julia-artifacts-jl-wek1vy-bin-directory-not-empty-enotempty/123142/4 "2024-11-27T18:17:56Z")

</div>

Great. Once you install an artifact with julia nightly you can go back to using julia 1.11, and it should not need to install the same artifact again.

---

<div class="post-metadata">

**Author:** ![visr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/visr/32/17204_2.png) [@visr](https://discourse.julialang.org/u/visr)\
**Post date:** [November 28, 2024, 3:12pm UTC](https://discourse.julialang.org/t/error-ioerror-rm-c-users-35879-julia-artifacts-jl-wek1vy-bin-directory-not-empty-enotempty/123142/5 "2024-11-28T15:12:59Z")

</div>

I regularly get this error on our Windows CI and locally. Retrying usually works. If I’m not mistaken it has to do with antivirus temporarily locking the file.  
See [Artifact folder could not be made on Windows. · Issue #3822 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/issues/3822).

The error message was improved in [Better error messages if artifact rename fails by nhz2 · Pull Request #3827 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/pull/3827).

And an automatic retry was added in [Retry artifact rename if it fails by nhz2 · Pull Request #4001 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/pull/4001).  
This was backported on the release-1.11 branch according to the checkmark in [[release-1.11] 1.11 backports by IanButterworth · Pull Request #4037 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/pull/4037). @ianshmean I don’t see the commit in the PR, nor in [Comparing master...release-1.11 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/compare/master...release-1.11). Not sure if I’m not looking well or that this fell between the cracks.

---

<div class="post-metadata">

**Author:** ![ianshmean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ianshmean/32/216042_2.png) [@ianshmean](https://discourse.julialang.org/u/ianshmean)\
**Post date:** [November 28, 2024, 3:16pm UTC](https://discourse.julialang.org/t/error-ioerror-rm-c-users-35879-julia-artifacts-jl-wek1vy-bin-directory-not-empty-enotempty/123142/6 "2024-11-28T15:16:57Z")

</div>

Huh. Odd. Can you try opening a PR to backport it.

---

<div class="post-metadata">

**Author:** ![visr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/visr/32/17204_2.png) [@visr](https://discourse.julialang.org/u/visr)\
**Post date:** [November 28, 2024, 3:39pm UTC](https://discourse.julialang.org/t/error-ioerror-rm-c-users-35879-julia-artifacts-jl-wek1vy-bin-directory-not-empty-enotempty/123142/7 "2024-11-28T15:39:19Z")

</div>

Done in [Backport artifact rename to 1.11 by visr · Pull Request #4099 · JuliaLang/Pkg.jl](https://github.com/JuliaLang/Pkg.jl/pull/4099).
