# Cannot install PyCall

**URL:** <https://discourse.julialang.org/t/cannot-install-pycall/109256>\
**Category:** General Usage\
**Tags:** question\
**Created:** [January 25, 2024, 2:09pm UTC](https://discourse.julialang.org/t/cannot-install-pycall/109256 "2024-01-25T14:09:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiang\_ming\_zhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jiang_ming_zhang/32/204063_2.png) [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Post date:** [January 25, 2024, 2:09pm UTC](https://discourse.julialang.org/t/cannot-install-pycall/109256/1 "2024-01-25T14:09:15Z")

</div>

It is the first time I cannot install a package by the standard pkg way. I am using vscode and windows 10.

I need this package because it is invoked in another package which I want to use.

What is the problem?

```julia
(@v1.10) pkg> add PyCall
   Resolving package versions...
  No Changes to `C:\Users\jmzhang\.julia\environments\v1.10\Project.toml`
  No Changes to `C:\Users\jmzhang\.julia\environments\v1.10\Manifest.toml`

julia> using PyCall
Precompiling PyCall
        Info Given PyCall was explicitly requested, output will be shown live
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\jmzhang\.julia\packages\PyCall\1gn3u\src\startup.jl:44
 [3] include(mod::Module, _path::String)
   @ Base .\Base.jl:495
 [4] include(x::String)
   @ PyCall C:\Users\jmzhang\.julia\packages\PyCall\1gn3u\src\PyCall.jl:1
 [5] top-level scope
   @ C:\Users\jmzhang\.julia\packages\PyCall\1gn3u\src\PyCall.jl:38
 [6] include
   @ Base .\Base.jl:495 [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, UInt128}}, source::Nothing)
   @ Base .\loading.jl:2216
 [8] top-level scope
   @ stdin:3
in expression starting at C:\Users\jmzhang\.julia\packages\PyCall\1gn3u\src\startup.jl:41
in expression starting at C:\Users\jmzhang\.julia\packages\PyCall\1gn3u\src\PyCall.jl:1
in expression starting at stdin:3
  ✗ PyCall
  0 dependencies successfully precompiled in 2 seconds. 7 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\\jmzhang\\.julia\\compiled\\v1.10\\PyCall\\jl_E3BC.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\jmzhang\.julia\packages\PyCall\1gn3u\src\startup.jl:44
 [3] include(mod::Module, _path::String)
   @ Base .\Base.jl:495
 [4] include(x::String)
   @ PyCall C:\Users\jmzhang\.julia\packages\PyCall\1gn3u\src\PyCall.jl:1
 [5] top-level scope
   @ C:\Users\jmzhang\.julia\packages\PyCall\1gn3u\src\PyCall.jl:38
 [6] include
   @ Base .\Base.jl:495 [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, UInt128}}, source::Nothing)
   @ Base .\loading.jl:2216
 [8] top-level scope
   @ stdin:3
in expression starting at C:\Users\jmzhang\.julia\packages\PyCall\1gn3u\src\startup.jl:41
in expression starting at C:\Users\jmzhang\.julia\packages\PyCall\1gn3u\src\PyCall.jl:1
in expression starting at stdin:
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\Types.jl:70
  [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{…}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, timing::Bool, _from_loading::Bool, kwargs::@Kwargs{…})
    @ Pkg.API C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\API.jl:1656
  [3] precompile(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{_from_loading::Bool})
    @ Pkg.API C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\API.jl:159
  [4] precompile
    @ Pkg.API C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\API.jl:147 [inlined]
  [5] #precompile#114
    @ Pkg.API C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\API.jl:146 [inlined]
  [6] #invokelatest#2
    @ Base .\essentials.jl:889 [inlined]
  [7] invokelatest
    @ Base .\essentials.jl:884 [inlined]
  [8] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1957
  [9] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1806
 [10] #invoke_in_world#3
    @ Base .\essentials.jl:921 [inlined]
 [11] invoke_in_world
    @ Base .\essentials.jl:918 [inlined]
 [12] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1797
 [13] macro expansion
    @ Base .\loading.jl:1784 [inlined]
 [14] macro expansion
    @ Base .\lock.jl:267 [inlined]
 [15] __require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1747
 [16] #invoke_in_world#3
    @ Base .\essentials.jl:921 [inlined]
 [17] invoke_in_world
    @ Base .\essentials.jl:918 [inlined]
 [18] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1740
 [19] eval
    @ .\boot.jl:385 [inlined]
 [20] eval
    @ .\Base.jl:88 [inlined]
 [21] repleval(m::Module, code::Expr, ::String)
    @ VSCodeServer c:\Users\jmzhang\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\repl.jl:229
 [22] (::VSCodeServer.var"#110#112"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer c:\Users\jmzhang\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\repl.jl:192
 [23] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging .\logging.jl:515
 [24] with_logger
    @ .\logging.jl:627 [inlined]
 [25] (::VSCodeServer.var"#109#111"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer c:\Users\jmzhang\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\repl.jl:193
 [26] #invokelatest#2
    @ Base .\essentials.jl:887 [inlined]
 [27] invokelatest(::Any)
    @ Base .\essentials.jl:884
 [28] (::VSCodeServer.var"#62#63")()
    @ VSCodeServer c:\Users\jmzhang\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\eval.jl:34
Some type information was truncated. Use `show(err)` to see complete types.

```

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [January 25, 2024, 3:00pm UTC](https://discourse.julialang.org/t/cannot-install-pycall/109256/2 "2024-01-25T15:00:41Z")

</div>

Hi! Have you tried running `Pkg.build("PyCall")` like the error message suggests?

---

<div class="post-metadata">

**Author:** ![jiang\_ming\_zhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jiang_ming_zhang/32/204063_2.png) [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Post date:** [January 26, 2024, 12:57am UTC](https://discourse.julialang.org/t/cannot-install-pycall/109256/3 "2024-01-26T00:57:57Z")

</div>

```julia
julia> using Pkg

julia> Pkg.build("PyCall")
    Building Conda ─→ `C:\Users\jmzhang\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\51cab8e982c5b598eea9c8ceaced4b58d9dd37c9\build.log`
    Building PyCall → `C:\Users\jmzhang\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\9816a3826b0ebf49ab4926e2b18842ad8b5c8f04\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 ...
ERROR: LoadError: RequestError: Failed to connect to github.com port 443 after 21093 ms: Couldn't connect to server while requesting https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe
Stacktrace:
  [1] (::Downloads.var"#9#18"{IOStream, Base.DevNull, Nothing, Vector{Pair{String, String}}, Float64, Nothing, Bool, Nothing, Bool, String, Bool, Bool})(easy::Downloads.Curl.Easy)
    @ Downloads C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Downloads\src\Downloads.jl:397
  [2] with_handle(f::Downloads.var"#9#18"{IOStream, Base.DevNull, Nothing, Vector{Pair{String, String}}, Float64, Nothing, Bool, Nothing, Bool, String, Bool, Bool}, 
handle::Downloads.Curl.Easy)
    @ Downloads.Curl C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Downloads\src\Curl\Curl.jl:94
  [3] #8
    @ C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Downloads\src\Downloads.jl:338 [inlined]
  [4] arg_write(f::Downloads.var"#8#17"{Base.DevNull, Nothing, Vector{Pair{String, String}}, Float64, Nothing, Bool, Nothing, Bool, String, Bool, Bool}, arg::IOStream)
    @ ArgTools C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\ArgTools\src\ArgTools.jl:134
  [5] #7
    @ C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Downloads\src\Downloads.jl:337 [inlined]
  [6] arg_read
    @ C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\ArgTools\src\ArgTools.jl:76 [inlined]
  [7] request(url::String; input::Nothing, output::IOStream, method::Nothing, headers::Vector{Pair{String, String}}, timeout::Float64, progress::Nothing, verbose::Bool, debug::Nothing, throw::Bool, downloader::Nothing)
    @ Downloads C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Downloads\src\Downloads.jl:336
  [8] request
    @ C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Downloads\src\Downloads.jl:304 [inlined]
  [9] #3
    @ C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Downloads\src\Downloads.jl:242 [inlined]
 [10] open(f::Downloads.var"#3#4"{Nothing, Vector{Pair{String, String}}, Float64, Nothing, Bool, Nothing, Nothing, String}, args::String; kwargs::@Kwargs{write::Bool, lock::Bool})
    @ Base .\io.jl:396
 [11] open_nolock
    @ ArgTools C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\ArgTools\src\ArgTools.jl:35 [inlined]
 [12] arg_write(f::Function, arg::String)
    @ ArgTools C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\ArgTools\src\ArgTools.jl:103
 [13] #download#2
    @ C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Downloads\src\Downloads.jl:241 [inlined]
 [14] download
    @ C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Downloads\src\Downloads.jl:230 [inlined]
 [15] _install_conda(env::String, force::Bool)
    @ Conda C:\Users\jmzhang\.julia\packages\Conda\sDjAP\src\Conda.jl:298
 [16] _install_conda(env::String)
    @ Conda C:\Users\jmzhang\.julia\packages\Conda\sDjAP\src\Conda.jl:270
 [17] runconda(args::Cmd, env::String)
    @ Conda C:\Users\jmzhang\.julia\packages\Conda\sDjAP\src\Conda.jl:180
 [18] add(pkg::String, env::String; channel::String, satisfied_skip_solve::Bool, args::Cmd)
    @ Conda C:\Users\jmzhang\.julia\packages\Conda\sDjAP\src\Conda.jl:343
 [19] top-level scope
    @ C:\Users\jmzhang\.julia\packages\PyCall\1gn3u\deps\build.jl:79
 [20] include(fname::String)
    @ Base.MainInclude .\client.jl:489
 [21] top-level scope
    @ none:5
in expression starting at C:\Users\jmzhang\.julia\packages\PyCall\1gn3u\deps\build.jl:43
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\Types.jl:70
  [2] (::Pkg.Operations.var"#67#74"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String})()
    @ Pkg.Operations C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\Operations.jl:1156
  [3] withenv(::Pkg.Operations.var"#67#74"{…}, ::Pair{…}, ::Vararg{…})
    @ Base .\env.jl:256
  [4] (::Pkg.Operations.var"#117#122"{String, Bool, Bool, Bool, Pkg.Operations.var"#67#74"{…}, Pkg.Types.PackageSpec})()
    @ Pkg.Operations C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\Operations.jl:1824
  [5] with_temp_env(fn::Pkg.Operations.var"#117#122"{…}, temp_env::String)
    @ Pkg.Operations C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\Operations.jl:1705
  [6] (::Pkg.Operations.var"#115#120"{…})(tmp::String)
    @ Pkg.Operations C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\Operations.jl:1794
  [7] mktempdir(fn::Pkg.Operations.var"#115#120"{…}, parent::String; prefix::String)
    @ Base.Filesystem .\file.jl:766
  [8] mktempdir(fn::Function, parent::String) (repeats 2 times)
    @ Base.Filesystem .\file.jl:762
  [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{…}, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool)
    @ Pkg.Operations C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\Operations.jl:1752
 [10] build_versions(ctx::Pkg.Types.Context, uuids::Set{Base.UUID}; verbose::Bool)
    @ Pkg.Operations C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\Operations.jl:1137
 [11] build_versions
    @ C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\Operations.jl:1055 [inlined]
 [12] build(ctx::Pkg.Types.Context, uuids::Set{Base.UUID}, verbose::Bool)
    @ Pkg.Operations C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\Operations.jl:995
 [13] build(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; verbose::Bool, kwargs::@Kwargs{io::Base.TTY})
    @ Pkg.API C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\API.jl:1056
 [14] build(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{})
    @ Pkg.API C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\API.jl:159
 [15] build(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\API.jl:148
 [16] build
    @ Pkg.API C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\API.jl:147 [inlined]
 [17] build(pkg::String)
    @ Pkg.API C:\Users\jmzhang\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\Pkg\src\API.jl:146
 [18] top-level scope
    @ REPL[7]:1
Some type information was truncated. Use `show(err)` to see complete types.

```

does not work.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [January 26, 2024, 1:05am UTC](https://discourse.julialang.org/t/cannot-install-pycall/109256/4 "2024-01-26T01:05:25Z")

</div>

This error message tells you what is happening:

> [@jiang\_ming\_zhang](#):
>
> ```julia
> [ Info: Downloading miniconda installer ...
> ERROR: LoadError: RequestError: Failed to connect to github.com port 443 after 21093 ms: Couldn't connect to server while requesting https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe
> 
> ```

This URL works for me. Maybe you have a firewall or something that is blocking that download for you?

If you are comfortable installing Python yourself, you can always download and install your own Python distribution and tell PyCall to use it as explained [here](https://github.com/JuliaPy/PyCall.jl#specifying-the-python-version).

---

<div class="post-metadata">

**Author:** ![jiang\_ming\_zhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jiang_ming_zhang/32/204063_2.png) [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Post date:** [January 26, 2024, 1:18am UTC](https://discourse.julialang.org/t/cannot-install-pycall/109256/5 "2024-01-26T01:18:18Z")

</div>

I see. I am from china.

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [January 26, 2024, 12:11pm UTC](https://discourse.julialang.org/t/cannot-install-pycall/109256/6 "2024-01-26T12:11:05Z")

</div>

You can also consider using PythonCall, it’s easier to install and a successor to PyCall.

---

<div class="post-metadata">

**Author:** ![Kamran](https://avatars.discourse-cdn.com/v4/letter/k/b9e5f3/32.png) [@Kamran](https://discourse.julialang.org/u/Kamran)\
**Post date:** [May 4, 2024, 6:27pm UTC](https://discourse.julialang.org/t/cannot-install-pycall/109256/7 "2024-05-04T18:27:45Z")

</div>

How you solved this problem? I am facing the same problem

---

<div class="post-metadata">

**Author:** ![jiang\_ming\_zhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jiang_ming_zhang/32/204063_2.png) [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Post date:** [May 5, 2024, 1:23am UTC](https://discourse.julialang.org/t/cannot-install-pycall/109256/8 "2024-05-05T01:23:47Z")

</div>

I later indeed instaled PyCall successfully as now I can use it.

But I do not remember how I solved it.

Possibly by connecting to a mirror?
