CondaPkg.jl icon indicating copy to clipboard operation
CondaPkg.jl copied to clipboard

Error using `pip_add` on Windows

Open ymtoo opened this issue 2 years ago • 6 comments

MWE:

julia> using CondaPkg

(jl_zo5d7y) pkg> conda pip_add numpy
    CondaPkg Found dependencies: C:\Users\Admin\AppData\Local\Temp\jl_zo5d7y\CondaPkg.toml
    CondaPkg Resolving changes
             + numpy (pip)
             + pip
    CondaPkg Creating environment
             │ C:\Users\Admin\.julia\artifacts\8a699d2ba8dad86c428374c177ac63f8a59fd8d9\bin\micromamba.exe
             │ -r C:\Users\Admin\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root
             │ create
             │ -y
             │ -p C:\Users\Admin\AppData\Local\Temp\jl_zo5d7y\.CondaPkg\env
             │ --override-channels
             │ --no-channel-priority
             │ pip[version='>=22.0.0']
             └ -c conda-forge

                                           __
          __  ______ ___  ____ _____ ___  / /_  ____ _
         / / / / __ `__ \/ __ `/ __ `__ \/ __ \/ __ `/
        / /_/ / / / / / / /_/ / / / / / / /_/ / /_/ /
       / .___/_/ /_/ /_/\__,_/_/ /_/ /_/_.___/\__,_/
      /_/

conda-forge/win-64                                          Using cache
conda-forge/noarch                                          Using cache

Transaction

  Prefix: C:\Users\Admin\AppData\Local\Temp\jl_zo5d7y\.CondaPkg\env

  Updating specs:

   - pip[version='>=22.0.0']


  Package                 Version  Build               Channel           Size
-------------------------------------------------------------------------------
  Install:
-------------------------------------------------------------------------------

  + bzip2                   1.0.8  h8ffe710_4          conda-forge     Cached
  + ca-certificates      2023.5.7  h56e8100_0          conda-forge     Cached
  + libexpat                2.5.0  h63175ca_1          conda-forge     Cached
  + libffi                  3.4.2  h8ffe710_5          conda-forge     Cached
  + libsqlite              3.42.0  hcfcfb64_0          conda-forge     Cached
  + libzlib                1.2.13  hcfcfb64_4          conda-forge     Cached
  + openssl                 3.1.0  hcfcfb64_3          conda-forge     Cached
  + pip                    23.1.2  pyhd8ed1ab_0        conda-forge     Cached
  + python                 3.11.3  h2628c8c_0_cpython  conda-forge     Cached
  + setuptools             67.7.2  pyhd8ed1ab_0        conda-forge     Cached
  + tk                     8.6.12  h8ffe710_0          conda-forge     Cached
  + tzdata                  2023c  h71feb2d_0          conda-forge     Cached
  + ucrt             10.0.22621.0  h57928b3_0          conda-forge     Cached
  + vc                       14.3  hb25d44b_16         conda-forge     Cached
  + vc14_runtime      14.34.31931  h5081d32_16         conda-forge     Cached
  + vs2015_runtime    14.34.31931  hed1258a_16         conda-forge     Cached
  + wheel                  0.40.0  pyhd8ed1ab_0        conda-forge     Cached
  + xz                      5.2.6  h8d14728_0          conda-forge     Cached

  Summary:

  Install: 18 packages

  Total download: 0 B

-------------------------------------------------------------------------------



Transaction starting
Linking libexpat-2.5.0-h63175ca_1
Linking ucrt-10.0.22621.0-h57928b3_0
Linking ca-certificates-2023.5.7-h56e8100_0
Linking vc14_runtime-14.34.31931-h5081d32_16
Linking vc-14.3-hb25d44b_16
Linking vs2015_runtime-14.34.31931-hed1258a_16
Linking libsqlite-3.42.0-hcfcfb64_0
Linking openssl-3.1.0-hcfcfb64_3
Linking libffi-3.4.2-h8ffe710_5
Linking bzip2-1.0.8-h8ffe710_4
Linking xz-5.2.6-h8d14728_0
Linking tk-8.6.12-h8ffe710_0
Linking libzlib-1.2.13-hcfcfb64_4
Linking tzdata-2023c-h71feb2d_0
Linking pip-23.1.2-pyhd8ed1ab_0
error    libmamba Error opening for writing "C:\\Users\\Admin\\AppData\\Local\\Temp\\jl_zo5d7y\\.CondaPkg\\env\\Scripts\\pip-script.py": No such file or directory
error    libmamba Error opening for writing "C:\\Users\\Admin\\AppData\\Local\\Temp\\jl_zo5d7y\\.CondaPkg\\env\\Scripts\\pip.exe": No such file or directory
critical libmamba permissions: The system cannot find the path specified.: "C:\Users\Admin\AppData\Local\Temp\jl_zo5d7y\.CondaPkg\env\Scripts\pip.exe"
ERROR: failed process: Process(`'C:\Users\Admin\.julia\artifacts\8a699d2ba8dad86c428374c177ac63f8a59fd8d9\bin\micromamba.exe' -r 'C:\Users\Admin\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root' create -y -p 'C:\Users\Admin\AppData\Local\Temp\jl_zo5d7y\.CondaPkg\env' --override-channels --no-channel-priority "pip[version='>=22.0.0']" -c conda-forge`, ProcessExited(1)) [1]

Stacktrace:
  [1] pipeline_error
    @ .\process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base .\process.jl:480
  [3] run(::Cmd)
    @ Base .\process.jl:477
  [4] _run(io::IO, cmd::Cmd, args::Any; flags::Any)
    @ CondaPkg C:\Users\Admin\.julia\packages\CondaPkg\osUdN\src\resolve.jl:370
  [5] _resolve_conda_install(io::Any, conda_env::Any, specs::Any, channels::Any; create::Any)
    @ CondaPkg C:\Users\Admin\.julia\packages\CondaPkg\osUdN\src\resolve.jl:271
  [6] resolve(; force::Bool, io::IO, interactive::Bool, dry_run::Bool)
    @ CondaPkg C:\Users\Admin\.julia\packages\CondaPkg\osUdN\src\resolve.jl:526
  [7] resolve()
    @ CondaPkg C:\Users\Admin\.julia\packages\CondaPkg\osUdN\src\resolve.jl:384
  [8] add(pkgs::AbstractVector; resolve::Any, file::Any, kw::Base.Pairs{Symbol, V, Tuple{Vararg{Symbol, N}}, NamedTuple{names, T}} where {V, N, names, T<:Tuple{Vararg{Any, N}}})
    @ CondaPkg C:\Users\Admin\.julia\packages\CondaPkg\osUdN\src\deps.jl:222
  [9] add(pkgs::AbstractVector)
    @ CondaPkg C:\Users\Admin\.julia\packages\CondaPkg\osUdN\src\deps.jl:215
 [10] pip_add(args::Vector{String}; binary::String)
    @ CondaPkg.PkgREPL C:\Users\Admin\.julia\packages\CondaPkg\osUdN\src\PkgREPL.jl:187
 [11] pip_add(args::Vector{String})
    @ CondaPkg.PkgREPL C:\Users\Admin\.julia\packages\CondaPkg\osUdN\src\PkgREPL.jl:186
 [12] do_cmd!(command::Pkg.REPLMode.Command, repl::REPL.LineEditREPL)
    @ Pkg.REPLMode C:\Users\Admin\AppData\Local\Programs\Julia-1.9.0\share\julia\stdlib\v1.9\Pkg\src\REPLMode\REPLMode.jl:412
 [13] do_cmd(repl::REPL.LineEditREPL, input::String; do_rethrow::Bool)
    @ Pkg.REPLMode C:\Users\Admin\AppData\Local\Programs\Julia-1.9.0\share\julia\stdlib\v1.9\Pkg\src\REPLMode\REPLMode.jl:390
 [14] do_cmd
    @ C:\Users\Admin\AppData\Local\Programs\Julia-1.9.0\share\julia\stdlib\v1.9\Pkg\src\REPLMode\REPLMode.jl:380 [inlined]
 [15] (::Pkg.REPLMode.var"#24#27"{REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool)
    @ Pkg.REPLMode C:\Users\Admin\AppData\Local\Programs\Julia-1.9.0\share\julia\stdlib\v1.9\Pkg\src\REPLMode\REPLMode.jl:557
 [16] #invokelatest#2
    @ .\essentials.jl:816 [inlined]
 [17] invokelatest
    @ .\essentials.jl:813 [inlined]
 [18] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit C:\Users\Admin\AppData\Local\Programs\Julia-1.9.0\share\julia\stdlib\v1.9\REPL\src\LineEdit.jl:2647
 [19] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL C:\Users\Admin\AppData\Local\Programs\Julia-1.9.0\share\julia\stdlib\v1.9\REPL\src\REPL.jl:1300
 [20] (::REPL.var"#62#68"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL .\task.jl:514

Julia and package versions:

julia> versioninfo()
Julia Version 1.9.0
Commit 8e63055292 (2023-05-07 11:25 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 4 × Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 1 on 4 virtual cores

(jl_zo5d7y) pkg> st
Status `C:\Users\Admin\AppData\Local\Temp\jl_zo5d7y\Project.toml`
  [992eb4ea] CondaPkg v0.2.18

This works fine on Linux machines.

ymtoo avatar May 25 '23 07:05 ymtoo

Thanks, I've had a couple of reports on this now. I suspect it's a Micromamba bug. What version of MicroMamba and micromamba_jll are you on?

cjdoris avatar May 25 '23 15:05 cjdoris

The versions of the dependencies:

(jl_yrusdV) pkg> st --manifest
Status `C:\Users\Admin\AppData\Local\Temp\jl_yrusdV\Manifest.toml`
  [992eb4ea] CondaPkg v0.2.18
  [692b3bcd] JLLWrappers v1.4.1
  [0f8b85d8] JSON3 v1.12.0
  [0b3b1443] MicroMamba v0.1.12
  [69de0a69] Parsers v2.5.10
  [fa939f87] Pidfile v1.3.0
  [aea7be01] PrecompileTools v1.1.1
  [21216c6a] Preferences v1.4.0
  [6c6a2e73] Scratch v1.2.0
  [66db9d55] SnoopPrecompile v1.0.3
  [856f2bd8] StructTypes v1.10.0
  [f8abcde7] micromamba_jll v1.4.3+0
  [0dad84c5] ArgTools v1.1.1
  [56f22d72] Artifacts
  [2a0f44e3] Base64
  [ade2ca70] Dates
  [f43a241f] Downloads v1.6.0
  [7b1f6079] FileWatching
  [b77e0a4c] InteractiveUtils
  [4af54fe1] LazyArtifacts
  [b27032c2] LibCURL v0.6.3
  [76f85450] LibGit2
  [8f399da3] Libdl
  [56ddb016] Logging
  [d6f4376e] Markdown
  [a63ad114] Mmap
  [ca575930] NetworkOptions v1.2.0
  [44cfe95a] Pkg v1.9.0
  [de0858da] Printf
  [3fa0cd96] REPL
  [9a3f8284] Random
  [ea8e919c] SHA v0.7.0
  [9e88b42a] Serialization
  [6462fe0b] Sockets
  [fa267f1f] TOML v1.0.3
  [a4e569a6] Tar v1.10.0
  [8dfed614] Test
  [cf7118a7] UUIDs
  [4ec0a83e] Unicode
  [deac9b47] LibCURL_jll v7.84.0+0
  [29816b5a] LibSSH2_jll v1.10.2+0
  [c8ffd9c3] MbedTLS_jll v2.28.2+0
  [14a3606d] MozillaCACerts_jll v2022.10.11
  [83775a58] Zlib_jll v1.2.13+0
  [8e850ede] nghttp2_jll v1.48.0+0
  [3f19e933] p7zip_jll v17.4.0+0

ymtoo avatar May 26 '23 01:05 ymtoo

I met this issue too.

Lightup1 avatar Jun 01 '23 09:06 Lightup1

Is there a quick method to fix it on the user side?

Lightup1 avatar Jun 01 '23 09:06 Lightup1

Is there a quick method to fix it on the user side?

Seems downgrading CondaPkg to v0.2.16 resolves the issue from the user side.

Lightup1 avatar Jun 01 '23 09:06 Lightup1

Pinning micromamba_jll to 1.4.1 for now will fix it.

cjdoris avatar Jun 02 '23 14:06 cjdoris

This was fixed upstream

cjdoris avatar Nov 08 '24 22:11 cjdoris