JuliaPy / JuliaPy/PythonCall.jl

Precompilation failure (InitError: failed process)

Abierto
#179 7 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Julia
Estrellas
1.1k
Forks
86
Merge medio
1 d 22 h
PR fusionados (30 d)
3

Descripción

When precompiling [Anneal.jl](https://github.com/psrenergy/Anneal.jl/tree/docs) (docs branch) there seems to be some process lock problem with libmamba.

The complete shell session is here: (.CondaPkg is created but left empty)
```julia
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS D:\gits\Anneal.jl> julia --project
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.7.0 (2021-11-30)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

(Anneal) pkg> precompile
Precompiling project...
✗ Anneal
0 dependencies successfully precompiled in 19 seconds (32 already precompiled)

ERROR: The following 1 direct dependency failed to precompile:

Anneal [e4d9eb7f-b088-426e-aeb5-1c0dae3d8abb]

Failed to precompile Anneal [e4d9eb7f-b088-426e-aeb5-1c0dae3d8abb] to C:\Users\pedroxavier\.julia\compiled\v1.7\Anneal\jl_E2.tmp.
CondaPkg Found dependencies: D:\gits\Anneal.jl\CondaPkg.toml
CondaPkg Found dependencies: C:\Users\pedroxavier\.julia\packages\PythonCall\4eoCM\CondaPkg.toml
CondaPkg Resolving changes
+ dwave-neal (pip)
+ pip
+ python
CondaPkg Installing packages
warning libmamba Cannot lock 'C:\Users\pedroxavier\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root\pkgs\cache'
Waiting for other mamba process to finish
error libmamba Path already locked by the same PID: 'C:\Users\pedroxavier\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root\pkgs\cache'
warning libmamba LockFile creation for path 'C:\Users\pedroxavier\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root\pkgs\cache' failed, continuing without it
error libmamba Path already locked by the same PID: 'C:\Users\pedroxavier\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root\pkgs\cache'
warning libmamba LockFile creation for path 'C:\Users\pedroxavier\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root\pkgs\cache' failed, continuing without it
error libmamba Path already locked by the same PID: 'C:\Users\pedroxavier\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root\pkgs\cache'
warning libmamba LockFile creation for path 'C:\Users\pedroxavier\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root\pkgs\cache' failed, continuing without it
error libmamba Path already locked by the same PID: 'C:\Users\pedroxavier\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root\pkgs\cache'
ERROR: LoadError: InitError: failed process: Process(`'C:\Users\pedroxavier\.julia\artifacts\d628738c351341856bc6e8abe94cd6c8d8a7bf66\Library\bin\micromamba.exe' -r 'C:\Users\pedroxavier\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root' create -q -y -p 'D:\gits\Anneal.jl\.CondaPkg\env' --override-channels --no-channel-priority pip "python[version='>=3.7,<4']" -c anaconda -c conda-forge`, ProcessExited(3221226505)) [3221226505]

Stacktrace:
[1] pipeline_error
@ .\process.jl:531 [inlined]
[2] run(::Cmd; wait::Bool)
@ Base .\process.jl:446
[3] run(::Cmd)
@ Base .\process.jl:444
[4] _run(io::IO, cmd::Cmd, args::Any; flags::Any)
@ CondaPkg C:\Users\pedroxavier\.julia\packages\CondaPkg\Olo5Y\src\resolve.jl:283
[5] _resolve_conda_install(io::Any, conda_env::Any, specs::Any, channels::Any; create::Any)
@ CondaPkg C:\Users\pedroxavier\.julia\packages\CondaPkg\Olo5Y\src\resolve.jl:191
[6] resolve(; force::Bool, io::IO, interactive::Bool, dry_run::Bool)
@ CondaPkg C:\Users\pedroxavier\.julia\packages\CondaPkg\Olo5Y\src\resolve.jl:395
[7] resolve()
@ CondaPkg C:\Users\pedroxavier\.julia\packages\CondaPkg\Olo5Y\src\resolve.jl:288
[8] envdir()
@ CondaPkg C:\Users\pedroxavier\.julia\packages\CondaPkg\Olo5Y\src\env.jl:70
[9] init_context()
@ PythonCall.C C:\Users\pedroxavier\.julia\packages\PythonCall\4eoCM\src\cpython\context.jl:56
[10] __init__()
@ PythonCall.C C:\Users\pedroxavier\.julia\packages\PythonCall\4eoCM\src\cpython\CPython.jl:21
[11] _include_from_serialized(path::String, depmods::Vector{Any})
@ Base .\loading.jl:768
[12] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
@ Base .\loading.jl:854
[13] _require(pkg::Base.PkgId)
@ Base .\loading.jl:1097
[14] require(uuidkey::Base.PkgId)
@ Base .\loading.jl:1013
[15] require(into::Module, mod::Symbol)
@ Base .\loading.jl:997
[16] include(mod::Module, _path::String)
@ Base .\Base.jl:418
[17] include(x::String)
@ Anneal D:\gits\Anneal.jl\src\Anneal.jl:1
[18] top-level scope
@ D:\gits\Anneal.jl\src\Anneal.jl:40
[19] include
@ .\Base.jl:418 [inlined]
[20] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
@ Base .\loading.jl:1318
[21] top-level scope
@ none:1
[22] eval
@ .\boot.jl:373 [inlined]
[23] eval(x::Expr)
@ Base.MainInclude .\client.jl:453
[24] top-level scope
@ none:1
during initialization of module C
in expression starting at D:\gits\Anneal.jl\src\annealers\simulated\simulated.jl:1
in expression starting at D:\gits\Anneal.jl\src\Anneal.jl:1

julia> versioninfo()
Julia Version 1.7.0
Commit 3bf9d17731 (2021-11-30 12:12 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-12.0.1 (ORCJIT, skylake)

julia> using Pkg; Pkg.status()
Project Anneal v0.1.0
Status `D:\gits\Anneal.jl\Project.toml`
[992eb4ea] CondaPkg v0.2.10
[b8f27783] MathOptInterface v1.2.0
[6099a3de] PythonCall v0.9.0
[9a3f8284] Random

julia> using CondaPkg; CondaPkg.status()
CondaPkg Status D:\gits\Anneal.jl\CondaPkg.toml
Not Resolved (resolve first for more information)
Packages
python (>=3.7,<4)
Channels
anaconda
conda-forge
Pip packages
dwave-neal (>=0.5.6)

julia> CondaPkg.re
read_deps read_meta resolve
julia> CondaPkg.resolve()
CondaPkg Found dependencies: D:\gits\Anneal.jl\CondaPkg.toml
CondaPkg Found dependencies: C:\Users\pedroxavier\.julia\packages\PythonCall\4eoCM\CondaPkg.toml
CondaPkg Resolving changes
+ dwave-neal (pip)
+ pip
+ python
CondaPkg Installing packages
warning libmamba Cannot lock 'C:\Users\pedroxavier\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root\pkgs\cache'
Waiting for other mamba process to finish
error libmamba Path already locked by the same PID: 'C:\Users\pedroxavier\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root\pkgs\cache'
warning libmamba LockFile creation for path 'C:\Users\pedroxavier\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root\pkgs\cache' failed, continuing without it
error libmamba Path already locked by the same PID: 'C:\Users\pedroxavier\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root\pkgs\cache'
warning libmamba LockFile creation for path 'C:\Users\pedroxavier\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root\pkgs\cache' failed, continuing without it
error libmamba Path already locked by the same PID: 'C:\Users\pedroxavier\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root\pkgs\cache'
warning libmamba LockFile creation for path 'C:\Users\pedroxavier\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root\pkgs\cache' failed, continuing without it
error libmamba Path already locked by the same PID: 'C:\Users\pedroxavier\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root\pkgs\cache'
ERROR: failed process: Process(`'C:\Users\pedroxavier\.julia\artifacts\d628738c351341856bc6e8abe94cd6c8d8a7bf66\Library\bin\micromamba.exe' -r 'C:\Users\pedroxavier\.julia\scratchspaces\0b3b1443-0f03-428d-bdfb-f27f9c1191ea\root' create -q -y -p 'D:\gits\Anneal.jl\.CondaPkg\env' --override-channels --no-channel-priority pip "python[version='>=3.7,<4']" -c anaconda -c conda-forge`, ProcessExited(3221226505)) [3221226505]

Stacktrace:
[1] pipeline_error
@ .\process.jl:531 [inlined]
[2] run(::Cmd; wait::Bool)
@ Base .\process.jl:446
[3] run(::Cmd)
@ Base .\process.jl:444
[4] _run(io::IO, cmd::Cmd, args::Any; flags::Any)
@ CondaPkg C:\Users\pedroxavier\.julia\packages\CondaPkg\Olo5Y\src\resolve.jl:283
[5] _resolve_conda_install(io::Any, conda_env::Any, specs::Any, channels::Any; create::Any)
@ CondaPkg C:\Users\pedroxavier\.julia\packages\CondaPkg\Olo5Y\src\resolve.jl:191
[6] resolve(; force::Bool, io::IO, interactive::Bool, dry_run::Bool)
@ CondaPkg C:\Users\pedroxavier\.julia\packages\CondaPkg\Olo5Y\src\resolve.jl:395
[7] resolve()
@ CondaPkg C:\Users\pedroxavier\.julia\packages\CondaPkg\Olo5Y\src\resolve.jl:288
[8] top-level scope
@ REPL[5]:1

julia>
```

PS: I have some experience with the Python C API . If you could provide some insights about your thought process on this topic, so I can learn more about the package, I'd be happy to make pull requests for PythonCall in the future!

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Reproduce the Windows failure with Julia 1.7 using CondaPkg.resolve() and precompile, then inspect CondaPkg's resolve.jl around lines 191 and 283 and PythonCall's cpython/context.jl init_context entry point. Done means the environment resolves and Anneal precompiles without the libmamba cache-lock failure.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
julia, python
Área
build-system
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.