Unable to build PyCall and RCall

Hi,

I have been trying to use the Data Science tutorials in Julia Academy. However, when comes the time to instantiate the missing Julia packages from the first Jupyter notebook, the installation fails either because PyCall can’t be built or (while I tried to the PyCall issue) RCall can’t be built. Here are below the error messages I get when I try to either build or update PyCall (RCall failed also because it needed an up-to-date version of PyCall):

julia> Pkg.update()
    Updating registry at `C:\Users\probi\.julia\registries\General.toml`
   Installed PyCall ─ v1.94.1
    Updating `C:\Users\probi\DataScience\Project.toml`
  [438e738f] ↑ PyCall v1.92.3 ⇒ v1.94.1
    Updating `C:\Users\probi\DataScience\Manifest.toml`
  [438e738f] ↑ PyCall v1.92.3 ⇒ v1.94.1
    Building PyCall → `C:\Users\probi\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\53b8b07b721b77144a0fbbbc2675222ebf40a02d\build.log`
ERROR: Error building `PyCall`:
┌ Info: Using the Python distribution in the Conda package by default.
└ To use a different Python version, set ENV["PYTHON"]="pythoncommand" and re-run Pkg.build("PyCall").
[ Info: Downloading miniconda installer ...
[ Info: Installing miniconda ...
ERROR: LoadError: failed process: Process(`'C:\Users\probi\.julia\conda\3\installer.exe' /S --no-shortcuts /NoRegistry=1 /AddToPath=0 /RegisterPython=0 '/D=C:\Users\probi\.julia\conda\3'`, ProcessExited(2)) [2]

Stacktrace:
  [1] pipeline_error
    @ .\process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base .\process.jl:480
  [3] run
    @ .\process.jl:477 [inlined]
  [4] _install_conda(env::String, force::Bool)
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:209
  [5] _install_conda(env::String)
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:191
  [6] runconda(args::Cmd, env::String)
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:126
  [7] add(pkg::String, env::String; channel::String)
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:222
  [8] add (repeats 2 times)
    @ C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:220 [inlined]
  [9] top-level scope
    @ C:\Users\probi\.julia\packages\PyCall\ygXW2\deps\build.jl:79
 [10] include(fname::String)
    @ Base.MainInclude .\client.jl:476
 [11] top-level scope
    @ none:5
in expression starting at C:\Users\probi\.julia\packages\PyCall\ygXW2\deps\build.jl:43
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Types.jl:67
  [2] (::Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String})()
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1060
  [3] withenv(::Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, ::Pair{String, String}, ::Vararg{Pair{String}
})
    @ Base .\env.jl:172
  [4] (::Pkg.Operations.var"#107#112"{String, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.PackageSpec})()
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1619
  [5] with_temp_env(fn::Pkg.Operations.var"#107#112"{String, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.PackageSpec}, temp_env::String)
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1493
  [6] (::Pkg.Operations.var"#105#110"{Dict{String, Any}, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String})(tmp::String)
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1582
  [7] mktempdir(fn::Pkg.Operations.var"#105#110"{Dict{String, Any}, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String}, parent::String; prefix::String)
    @ Base.Filesystem .\file.jl:764
  [8] mktempdir(fn::Function, parent::String) (repeats 2 times)
    @ Base.Filesystem .\file.jl:760
  [9] sandbox(fn::Function, ctx::Pkg.Types.Context, target::Pkg.Types.PackageSpec, target_path::String, sandbox_path::String, sandbox_project_override::Pkg.Types.Project; preferences::Dict{String, Any}, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool)
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1540
 [10] build_versions(ctx::Pkg.Types.Context, uuids::Set{Base.UUID}; verbose::Bool)
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1041
 [11] build_versions(ctx::Pkg.Types.Context, uuids::Set{Base.UUID})
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:956
 [12] up(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, level::Pkg.Types.UpgradeLevel; skip_writing_project::Bool)
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1370
 [13] up(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; level::Pkg.Types.UpgradeLevel, mode::Pkg.Types.PackageMode, update_registry::Bool, skip_writing_project::Bool, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
    @ Pkg.API C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:341
 [14] up(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Pkg.Types.PackageMode, Tuple{Symbol}, NamedTuple{(:mode,), Tuple{Pkg.Types.PackageMode}}})
    @ Pkg.API C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:156
 [15] up(; name::Nothing, uuid::Nothing, version::Nothing, url::Nothing, rev::Nothing, path::Nothing, mode::Pkg.Types.PackageMode, subdir::Nothing, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:171
 [16] up()
    @ Pkg.API C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:162
 [17] top-level scope
    @ REPL[43]:1

Obviously, I need some guidance to get out of that installation vicious circle, as the instructions from @logankilpatrick in the tutorial are not really covering that scenario (his are more for Mac or maybe Linux users and cover only RCall).

I am using Julia 1.8.4 on a Windows 11 environment. If that could help in any way, I have a few Anaconda environments where I have versions of Python and R installed.

Regards,

Patrick

2 Likes

Can you take a look at, or post here the contents of, C:\Users\probi\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\53b8b07b721b77144a0fbbbc2675222ebf40a02d\build.log
to get an idea why the miniconda installation failed?

It looks the same as part of the output I have shown above:

┌ Info: Using the Python distribution in the Conda package by default.
└ To use a different Python version, set ENV["PYTHON"]="pythoncommand" and re-run Pkg.build("PyCall").
[ Info: Downloading miniconda installer ...
[ Info: Installing miniconda ...
ERROR: LoadError: failed process: Process(`'C:\Users\probi\.julia\conda\3\installer.exe' /S --no-shortcuts /NoRegistry=1 /AddToPath=0 /RegisterPython=0 
'/D=C:\Users\probi\.julia\conda\3'`, ProcessExited(2)) [2]

Stacktrace:
  [1] pipeline_error
    @ .\process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base .\process.jl:480
  [3] run
    @ .\process.jl:477 [inlined]
  [4] _install_conda(env::String, force::Bool)
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:209
  [5] _install_conda(env::String)
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:191
  [6] runconda(args::Cmd, env::String)
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:126
  [7] add(pkg::String, env::String; channel::String)
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:222
  [8] add (repeats 2 times)
    @ C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:220 [inlined]
  [9] top-level scope
    @ C:\Users\probi\.julia\packages\PyCall\ygXW2\deps\build.jl:79
 [10] include(fname::String)
    @ Base.MainInclude .\client.jl:476
 [11] top-level scope
    @ none:5
in expression starting at C:\Users\probi\.julia\packages\PyCall\ygXW2\deps\build.jl:43

That’s underwhelming :smile:

Try executing the miniconda installer by hand from the terminal then:

C:\Users\probi\.julia\conda\3\installer.exe /S --no-shortcuts /NoRegistry=1 /AddToPath=0 /RegisterPython=0 /D=C:\Users\probi\.julia\conda\3

Apologies for the delayed reply, life got in the way.

I executed the miniconda installer by hand and it seemed to work (no error messages). Then I tried to instantiate the packages in the DataScience folder and obtained the following:

(DataScience) pkg> instantiate
┌ Warning: The active manifest file is an older format with no julia version entry. Dependencies may have been resolved with a different julia version.
└ @ C:\Users\probi\DataScience\Manifest.toml:0
Precompiling project...
  ✗ PyCall
  33 dependencies successfully precompiled in 170 seconds. 392 already precompiled. 7 skipped during auto due to previous errors.
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package

As prompted, I ran Pkg.precompile(). Then I got a long error message indicating that 5 direct dependencies failed to precompile (PyCall, JLD, HDF5, MAT, RCall). Again, as prompted, I tried to build these packages individually. It seemed to work for JLD, HDF5 and MAT. Then I tried PyCall and here’s what I obtained:

julia> Pkg.build("PyCall")
    Building Conda ─→ `C:\Users\probi\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\6e47d11ea2776bc5627421d59cdcc1296c058071\build.log`
    Building PyCall → `C:\Users\probi\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\53b8b07b721b77144a0fbbbc2675222ebf40a02d\build.log`
ERROR: Error building `PyCall`:
┌ Info: Using the Python distribution in the Conda package by default.
└ To use a different Python version, set ENV["PYTHON"]="pythoncommand" and re-run Pkg.build("PyCall").
[ Info: Downloading miniconda installer ...
[ Info: Installing miniconda ...
ERROR: LoadError: failed process: Process(`'C:\Users\probi\.julia\conda\3\installer.exe' /S --no-shortcuts /NoRegistry=1 /AddToPath=0 /RegisterPython=0 '/D=C:\Users\probi\.julia\conda\3'`, ProcessExited(2)) [2]

Stacktrace:
  [1] pipeline_error
    @ .\process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base .\process.jl:480
  [3] run
    @ .\process.jl:477 [inlined]
  [4] _install_conda(env::String, force::Bool)
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:209
  [5] _install_conda(env::String)
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:191
  [6] runconda(args::Cmd, env::String)
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:126
  [7] add(pkg::String, env::String; channel::String)
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:222
  [8] add (repeats 2 times)
    @ C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:220 [inlined]
  [9] top-level scope
    @ C:\Users\probi\.julia\packages\PyCall\ygXW2\deps\build.jl:79
 [10] include(fname::String)
    @ Base.MainInclude .\client.jl:476
 [11] top-level scope
    @ none:5
in expression starting at C:\Users\probi\.julia\packages\PyCall\ygXW2\deps\build.jl:43
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Types.jl:67
  [2] (::Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String})()
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1060
  [3] withenv(::Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, ::Pair{String, String}, ::Vararg{Pair{String}})
    @ Base .\env.jl:172
  [4] (::Pkg.Operations.var"#107#112"{String, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.PackageSpec})()
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1619
  [5] with_temp_env(fn::Pkg.Operations.var"#107#112"{String, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.PackageSpec}, temp_env::String)
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1493
  [6] (::Pkg.Operations.var"#105#110"{Dict{String, Any}, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String})(tmp::String)
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1582
  [7] mktempdir(fn::Pkg.Operations.var"#105#110"{Dict{String, Any}, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String}, parent::String; prefix::String)
    @ Base.Filesystem .\file.jl:764
  [8] mktempdir(fn::Function, parent::String) (repeats 2 times)
    @ Base.Filesystem .\file.jl:760
  [9] sandbox(fn::Function, ctx::Pkg.Types.Context, target::Pkg.Types.PackageSpec, target_path::String, sandbox_path::String, sandbox_project_override::Pkg.Types.Project; preferences::Dict{String, Any}, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool)
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1540
 [10] build_versions(ctx::Pkg.Types.Context, uuids::Set{Base.UUID}; verbose::Bool)
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1041
 [11] build(ctx::Pkg.Types.Context, uuids::Set{Base.UUID}, verbose::Bool)
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:898
 [12] build(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; verbose::Bool, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
    @ Pkg.API C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:1029
 [13] build(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:156
 [14] build(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:145
 [15] #build#99
    @ C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:144 [inlined]
 [16] build
    @ C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:144 [inlined]
 [17] #build#98
    @ C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:143 [inlined]
 [18] build(pkg::String)
    @ Pkg.API C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:143
 [19] top-level scope
    @ REPL[11]:1

Something clearly does not work as it should with PyCall. I haven’t tried RCall this time, but I suspect I would obtain the same result.

Could you try to simplify this first. Let’s just create a temporary environment with just PyCall.

using Pkg
pkg"activate --temp"
pkg"add PyCall" # this might succeed making the subsequent steps unnecessary
pkg"build PyCall"
Pkg.precompile()

Part of the issue is that PyCall.jl might not have setup the configuration files it needs. In particular, we want to see a .julia\conda\deps.jl file that looks like this.

const ROOTENV = "C:\\Users\\mkitti\\.julia\\conda\\3"
const MINICONDA_VERSION = "3"
const USE_MINIFORGE = false
const CONDA_EXE = "C:\\Users\\mkitti\\.julia\\conda\\3\\Scripts\\conda.exe"

The problem package here is actually Conda.jl:

To the next step might be to isolate that package and see if we can figure out why the conda process is exiting with an error in this case.

@mkitti There is already a deps.jl file, and the contents are identical to yours (except for a different username).

I tried setting up a temporary environment as you suggested, but it fails at “add PyCall”:

Precompiling project...
  ✗ PyCall
  0 dependencies successfully precompiled in 1 seconds. 12 already precompiled.
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package

And then again at “build PyCall”:

(jl_SLSVKk) pkg> build PyCall
    Building Conda ─→ `C:\Users\probi\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\6e47d11ea2776bc5627421d59cdcc1296c058071\build.log`
    Building PyCall → `C:\Users\probi\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\53b8b07b721b77144a0fbbbc2675222ebf40a02d\build.log`
ERROR: Error building `PyCall`:
┌ Info: Using the Python distribution in the Conda package by default.
└ To use a different Python version, set ENV["PYTHON"]="pythoncommand" and re-run Pkg.build("PyCall").
[ Info: Downloading miniconda installer ...
[ Info: Installing miniconda ...
ERROR: LoadError: failed process: Process(`'C:\Users\probi\.julia\conda\3\installer.exe' /S --no-shortcuts /NoRegistry=1 /AddToPath=0 /RegisterPython=0 '/D=C:\Users\probi\.julia\conda\3'`, ProcessExited(2)) [2]

Stacktrace:
  [1] pipeline_error
    @ .\process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base .\process.jl:480
  [3] run
    @ .\process.jl:477 [inlined]
  [4] _install_conda(env::String, force::Bool)
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:209
  [5] _install_conda(env::String)
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:191
  [6] runconda(args::Cmd, env::String)
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:126
  [7] add(pkg::String, env::String; channel::String)
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:222
  [8] add (repeats 2 times)
    @ C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:220 [inlined]
  [9] top-level scope
    @ C:\Users\probi\.julia\packages\PyCall\ygXW2\deps\build.jl:79
 [10] include(fname::String)
    @ Base.MainInclude .\client.jl:476
 [11] top-level scope
    @ none:5
in expression starting at C:\Users\probi\.julia\packages\PyCall\ygXW2\deps\build.jl:43

Likewise with Pkg.precompile():

julia> Pkg.precompile()
Precompiling project...
  ✗ PyCall
  0 dependencies successfully precompiled in 1 seconds. 12 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

PyCall [438e738f-606a-5dbb-bf0a-cddfbfd45ab0]

Failed to precompile PyCall [438e738f-606a-5dbb-bf0a-cddfbfd45ab0] to C:\Users\probi\.julia\compiled\v1.8\PyCall\jl_EDDF.tmp.
ERROR: LoadError: PyCall not properly installed. Please run Pkg.build("PyCall")
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:35
 [2] top-level scope
   @ C:\Users\probi\.julia\packages\PyCall\ygXW2\src\startup.jl:44
 [3] include(mod::Module, _path::String)
   @ Base .\Base.jl:419
 [4] include(x::String)
   @ PyCall C:\Users\probi\.julia\packages\PyCall\ygXW2\src\PyCall.jl:1
 [5] top-level scope
   @ C:\Users\probi\.julia\packages\PyCall\ygXW2\src\PyCall.jl:38
 [6] include
   @ .\Base.jl:419 [inlined]
 [7] 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:1554
 [8] top-level scope
   @ stdin:1
in expression starting at C:\Users\probi\.julia\packages\PyCall\ygXW2\src\startup.jl:41
in expression starting at C:\Users\probi\.julia\packages\PyCall\ygXW2\src\PyCall.jl:1
in expression starting at stdin:1
Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Types.jl:67
 [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{String}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:1435
 [3] precompile
   @ C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:1072 [inlined]
 [4] #precompile#225
   @ C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:1071 [inlined]
 [5] precompile (repeats 2 times)
   @ C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:1071 [inlined]
 [6] top-level scope
   @ REPL[5]:1

This is confusing. I know you already tries this from the terminal, but let’s this from Julia.

run(Cmd(`'C:\Users\probi\.julia\conda\3\installer.exe' /S --no-shortcuts /NoRegistry=1 /AddToPath=0 /RegisterPython=0 '/D=C:\Users\probi\.julia\conda\3'`, windows_verbatim=true))

Alas, no cigar:

julia> run(Cmd(`'C:\Users\probi\.julia\conda\3\installer.exe' /S --no-shortcuts /NoRegistry=1 /AddToPath=0 /RegisterPython=0 '/D=C:\Users\probi\.julia\conda\3'`, windows_verbatim=true))
ERROR: failed process: Process(`'C:\Users\probi\.julia\conda\3\installer.exe' /S --no-shortcuts /NoRegistry=1 /AddToPath=0 /RegisterPython=0 '/D=C:\Users\probi\.julia\conda\3'`, ProcessExited(2)) [2]

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] top-level scope
   @ REPL[6]:1

It turns out that /S means silent mode. Let’s turn that off.

run(Cmd(`'C:\Users\probi\.julia\conda\3\installer.exe' --no-shortcuts /NoRegistry=1 /AddToPath=0 /RegisterPython=0 '/D=C:\Users\probi\.julia\conda\3'`, windows_verbatim=true))

Well hmm, that pulls up the GUI installer for me.

Have you tried PythonCall.jl?

That will use a different route via micromamba.

Same here

I could try, but the problem is that this was meant to work so that people can use the Julia for Data Science tutorial from Julia Academy. I guess that if it doesn’t work for me, it might not be working for other people (surely, I’m not the only one using Julia on Windows…). And it seems that using PyCall is the default way of installing these packages.

Does the GUI installer succeed at installing into C:\Users\probi\.julia\conda\3 ?

The GUI offered me to install miniconda at C:\Users\probi\miniconda3. I tried changing it to C:\Users\probi\.julia\conda\3 but the installer complained that the folder was not empty (it already contains a folder with the installer and and the deps.jl file). So I finished the installation manually in the proposed miniconda3 folder. And, predictably, this didn’t fix the PyCall problem either.

Should I delete the ‘conda\3’ folder and try again?

Note: it’s not the first time I have had problems with Anaconda/miniconda on Windows. I remember once that the developers had to make substantial changes to prevent certain situations on Windows; I wouldn’t be surprised this would fall in the same bucket of problems…

Perhaps. Just delete the .julia/conda directory and try again.

Nope, it just re-creates the folder and fails to build PyCall:

julia> Pkg.build("PyCall")
    Building Conda ─→ `C:\Users\probi\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\6e47d11ea2776bc5627421d59cdcc1296c058071\build.log`
    Building PyCall → `C:\Users\probi\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\53b8b07b721b77144a0fbbbc2675222ebf40a02d\build.log`
ERROR: Error building `PyCall`:
┌ Info: Using the Python distribution in the Conda package by default.
└ To use a different Python version, set ENV["PYTHON"]="pythoncommand" and re-run Pkg.build("PyCall").
[ Info: Downloading miniconda installer ...
[ Info: Installing miniconda ...jl:476
ERROR: LoadError: failed process: Process(`'C:\Users\probi\.julia\conda\3\installer.exe' /S --no-shortcuts /NoRegistry=1 /AddToPath=0 /RegisterPython=0 '/D=C:\Users\probi\.julia\conda\3'`, ProcessExited(2)) [2]
in expression starting at C:\Users\probi\.julia\packages\PyCall\ygXW2\deps\build.jl:43
Stacktrace:
  [1] pipeline_errorString)
    @ .\process.jl:565 [inlined]ppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Types.jl:67
  [2] run(::Cmd; wait::Bool)#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String})()
    @ Base .\process.jl:480rs\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:106
  [3] run
    @ .\process.jl:477 [inlined]ar"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, ::Pair{Strin
  [4] _install_conda(env::String, force::Bool)
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:209
  [5] _install_conda(env::String)112"{String, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, Stri
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:191
  [6] runconda(args::Cmd, env::String)pData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:161
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:126
  [7] add(pkg::String, env::String; channel::String){String, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, Pkg.Type
    @ Conda C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:222c}, temp_env::String)
  [8] add (repeats 2 times)rs\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:149
    @ C:\Users\probi\.julia\packages\Conda\x2UxR\src\Conda.jl:220 [inlined]
  [9] top-level scopens.var"#105#110"{Dict{String, Any}, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Co
    @ C:\Users\probi\.julia\packages\PyCall\ygXW2\deps\build.jl:79Pkg.Types.PackageSpec, String, Pkg.Types.Project, Stri
 [10] include(fname::String)
    @ Base.MainInclude .\client.jl:476pData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:158
 [11] top-level scope
    @ none:5dir(fn::Pkg.Operations.var"#105#110"{Dict{String, Any}, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, P
in expression starting at C:\Users\probi\.julia\packages\PyCall\ygXW2\deps\build.jl:43.PackageSpec, String, Pkg.Types.Pr
Stacktrace:ng}, parent::String; prefix::String)
  [1] pkgerror(msg::String)e.jl:764
    @ Pkg.Types C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Types.jl:67
  [2] (::Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String})()
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1060ing, sandbox_project_override::Pkg.Types.Project; preferences::Dict{String, Any}, force_latest_compatible_version::Bool
  [3] withenv(::Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, ::Pair{String, String}, ::Vararg{Pair{String}})\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:154
    @ Base .\env.jl:172
  [4] (::Pkg.Operations.var"#107#112"{String, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.PackageSpec})()lia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:104
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1619[11] build(ctx::Pkg.Types.Context, uuids::Set{Base.UUID}, verbose::Bool)
  [5] with_temp_env(fn::Pkg.Operations.var"#107#112"{String, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.PackageSpec}, temp_env::String)gs::Base.Pairs{Symbol, Base.
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1493   @ Pkg.API C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:1029
  [6] (::Pkg.Operations.var"#105#110"{Dict{String, Any}, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String})(tmp::String)Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:156
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1582   @ Pkg.API C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:145
  [7] mktempdir(fn::Pkg.Operations.var"#105#110"{Dict{String, Any}, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String}, parent::String; prefix::String)
    @ Base.Filesystem .\file.jl:764Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:144 [inlined]
  [8] mktempdir(fn::Function, parent::String) (repeats 2 times)
    @ Base.Filesystem .\file.jl:760Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:143 [inlined]
  [9] sandbox(fn::Function, ctx::Pkg.Types.Context, target::Pkg.Types.PackageSpec, target_path::String, sandbox_path::String, sandbox_project_override::Pkg.Types.Project; preferences::Dict{String, Any}, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool)
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1540
 [10] build_versions(ctx::Pkg.Types.Context, uuids::Set{Base.UUID}; verbose::Bool)
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1041
 [11] build(ctx::Pkg.Types.Context, uuids::Set{Base.UUID}, verbose::Bool)
    @ Pkg.Operations C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:898
 [12] build(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; verbose::Bool, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
    @ Pkg.API C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:1029
 [13] build(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:156
 [14] build(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:145
 [15] #build#99
    @ C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:144 [inlined]
 [16] build
    @ C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:144 [inlined]
 [17] #build#98
    @ C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:143 [inlined]
 [18] build(pkg::String)
    @ Pkg.API C:\Users\probi\AppData\Local\Programs\Julia-1.8.4\share\julia\stdlib\v1.8\Pkg\src\API.jl:143
 [19] top-level scope
    @ REPL[9]:1

Out of curiosity, I checked the build.log in the scratchspace for building Conda and found this:

┌ Info: CONDA_EXE not found. Reverting to default in ROOTENV
│   CONDA_EXE = "C:\\Users\\probi\\.julia\\conda\\3\\Scripts\\conda.exe"
└   ROOTENV = "C:\\Users\\probi\\.julia\\conda\\3"

Not sure whether this could help…

This is interesting. Does C:\\Users\\probi\\.julia\\conda\\3\\Scripts\\conda.exe exist?

You can try setting ENV["PYTHON"] to the location of your working python.exe and then do

ENV["PYTHON"] = "C:\Users\probi\miniconda3\bin\python.exe" # check that this exists
using Pkg
pkg"build PyCall"

No. As I said above, the only things that were created in the conda folder are: 1- the ‘3’ folder with the installer; 2- the deps.jl file. There were no other folders or files (so, ‘Scripts’ wasn’t there either).

Your other suggestion seemed to have worked:

julia> ENV["PYTHON"] = "C:\\Users\\probi\\miniconda3\\python.exe"
"C:\\Users\\probi\\miniconda3\\python.exe"

julia> using Pkg

(jl_SLSVKk) pkg> build PyCall
    Building Conda ─→ `C:\Users\probi\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\6e47d11ea2776bc5627421d59cdcc1296c058071\build.log`
    Building PyCall → `C:\Users\probi\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\53b8b07b721b77144a0fbbbc2675222ebf40a02d\build.log`

julia> Pkg.precompile()
Precompiling project...
  1 dependency successfully precompiled in 4 seconds. 12 already precompiled.
1 Like