V1.4 failed to precompile PyCall and PyPlot on windows 7 x64

I initially would like to use PyPlot. The error message prompted me to rebuild PyCall.
V1.4, Windows 7 x64.
I then use this command

using Pkg
Pkg.build(“PyCall”)

But it did not solve the problem. I was unable to build PyCall.

The error message is below:

julia> using PyPlot
[ Info: Precompiling PyPlot [d330b81b-6aea-500a-939a-2ce795aea3ee]
ERROR: LoadError: LoadError: PyCall not properly installed. Please run Pkg.build(“PyCall”)
Stacktrace:
[1] error(::String) at .\error.jl:33
[2] top-level scope at C:\Users\a225.julia\packages\PyCall\zqDXB\src\startup.jl:44
[3] include(::Module, ::String) at .\Base.jl:377
[4] include(::String) at C:\Users\a225.julia\packages\PyCall\zqDXB\src\PyCall.jl:1
[5] top-level scope at C:\Users\a225.julia\packages\PyCall\zqDXB\src\PyCall.jl:34
[6] include(::Module, ::String) at .\Base.jl:377
[7] top-level scope at none:2
[8] eval at .\boot.jl:331 [inlined]
[9] eval(::Expr) at .\client.jl:449
[10] top-level scope at .\none:3
in expression starting at C:\Users\a225.julia\packages\PyCall\zqDXB\src\startup.jl:41
in expression starting at C:\Users\a225.julia\packages\PyCall\zqDXB\src\PyCall.jl:34
ERROR: LoadError: Failed to precompile PyCall [438e738f-606a-5dbb-bf0a-cddfbfd45ab0] to C:\Users\a225.julia\compiled\v1.4\PyCall\GkzkC_whFRm.ji.
Stacktrace:
[1] error(::String) at .\error.jl:33
[2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1272
[3] _require(::Base.PkgId) at .\loading.jl:1029
[4] require(::Base.PkgId) at .\loading.jl:927
[5] require(::Module, ::Symbol) at .\loading.jl:922
[6] include(::Module, ::String) at .\Base.jl:377
[7] top-level scope at none:2
[8] eval at .\boot.jl:331 [inlined]
[9] eval(::Expr) at .\client.jl:449
[10] top-level scope at .\none:3
in expression starting at C:\Users\a225.julia\packages\PyPlot\XHEG0\src\PyPlot.jl:4
ERROR: Failed to precompile PyPlot [d330b81b-6aea-500a-939a-2ce795aea3ee] to C:\Users\a225.julia\compiled\v1.4\PyPlot\oatAj_whFRm.ji.
Stacktrace:
[1] error(::String) at .\error.jl:33
[2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1272
[3] _require(::Base.PkgId) at .\loading.jl:1029
[4] require(::Base.PkgId) at .\loading.jl:927
[5] require(::Module, ::Symbol) at .\loading.jl:922

Error message after Julia failed to build PyCall

julia> Pkg.build(“PyCall”)
Building Conda ─→ C:\Users\a225\.julia\packages\Conda\3rPhK\deps\build.log

Building PyCall → C:\Users\a225\.julia\packages\PyCall\zqDXB\deps\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: failed process: Process('C:\Windows\System32\WindowsPowerSh ell\v1.0\powershell.exe' -Version 3 -NoProfile -Command "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; (New-Object System.Net.Webclient).DownloadFile('https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe', 'C:\Users\a225\.julia\conda\3\installer.exe')",
ProcessExited(3221225477)) [3221225477]

│ Stacktrace:
│ [1] pipeline_error at .\process.jl:525 [inlined]
│ [2] download_powershell(::String, ::String) at .\download.jl:20
│ [3] download at .\download.jl:64 [inlined]
│ [4] _install_conda(::String, ::Bool) at C:\Users\a225.julia\packages\Conda\3
rPhK\src\Conda.jl:164
│ [5] _install_conda(::String) at C:\Users\a225.julia\packages\Conda\3rPhK\src
\Conda.jl:155
│ [6] runconda(::Cmd, ::String) at C:\Users\a225.julia\packages\Conda\3rPhK\sr
c\Conda.jl:112
│ [7] add(::String, ::String; channel::String) at C:\Users\a225.julia\packages
\Conda\3rPhK\src\Conda.jl:188
│ [8] add at C:\Users\a225.julia\packages\Conda\3rPhK\src\Conda.jl:187 [inline
d] (repeats 2 times)
│ [9] top-level scope at C:\Users\a225.julia\packages\PyCall\zqDXB\deps\build.
jl:84
│ [10] include(::String) at .\client.jl:439
│ [11] top-level scope at none:5
│ in expression starting at C:\Users\a225.julia\packages\PyCall\zqDXB\deps\buil
d.jl:43
└ @ Pkg.Operations D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib
\v1.4\Pkg\src\Operations.jl:892

Downloading miniconda failed — note the error message says that

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Version 3 -NoProfile -Command "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; (New-Object System.Net.Webclient).DownloadFile('https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe')"

failed. You could try running this in at a Windows console to see if you get a more informative error message, but I’m guessing it’s some kind of firewall thing?

A post was merged into an existing topic: Why cannot Julia v1.4 find the installed Python?

Hi,
Do I need to add miniconda package to resolve this problem?

  1. I installed Python V3.8 on windows 7 x64 and would like to rebuild PyCall.
  2. I added PyCall package.
  3. I changed the global variable ENV

ENV[“PYTHON”] = “D:\programs\python\v38\python.exe”

  1. Then I use the command

using Pkg;Pkg.build(“PyCall”)

I got the following error. Julia v1.4 cannot find Python v3.8 I have installed on the folder, although I set the global variable ENV.

julia> using Pkg;Pkg.build("PyCall")
   Building Conda ─→ `C:\Users\a225\.julia\packages\Conda\3rPhK\deps\bui
ld.log`
   Building PyCall → `C:\Users\a225\.julia\packages\PyCall\zqDXB\deps\bui
ld.log`
┌ Error: Error building `PyCall`:
│ ┌ Info: No system-wide Python was found; got the following error:
│ │ ErrorException("D:\\programs\\python\\v38\\python.exe is 32-bit, but
 Julia is 64-bit")
│ └ using the Python distribution in the Conda package
│ [ Info: Downloading miniconda installer ...
│ ERROR: LoadError: failed process: Process(`'C:\Windows\System32\Windows
PowerShell\v1.0\powershell.exe' -Version 3 -NoProfile -Command "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; (New-Object System.Net.Webclient).DownloadFile('https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe', 'C:\Users\a225\.julia\conda\3\installer.exe')"`, ProcessExited(3221225477)) [3221225477]
│ 
│ Stacktrace:
│  [1] pipeline_error at .\process.jl:525 [inlined]
│  [2] download_powershell(::String, ::String) at .\download.jl:20
│  [3] download at .\download.jl:64 [inlined]
│  [4] _install_conda(::String, ::Bool) at C:\Users\a225\.julia\packages\
Conda\3rPhK\src\Conda.jl:164
│  [5] _install_conda(::String) at C:\Users\a225\.julia\packages\Conda\3r
PhK\src\Conda.jl:155
│  [6] runconda(::Cmd, ::String) at C:\Users\a225\.julia\packages\Conda\3
rPhK\src\Conda.jl:112
│  [7] add(::String, ::String; channel::String) at C:\Users\a225\.julia\p
ackages\Conda\3rPhK\src\Conda.jl:188
│  [8] add at C:\Users\a225\.julia\packages\Conda\3rPhK\src\Conda.jl:187
[inlined] (repeats 2 times)
│  [9] top-level scope at C:\Users\a225\.julia\packages\PyCall\zqDXB\deps
\build.jl:84
│  [10] include(::String) at .\client.jl:439
│  [11] top-level scope at none:5
│ in expression starting at C:\Users\a225\.julia\packages\PyCall\zqDXB\de
ps\build.jl:43
└ @ Pkg.Operations D:\buildbot\worker\package_win64\build\usr\share\julia
\stdlib\v1.4\Pkg\src\Operations.jl:892

ErrorException("D:\\programs\\python\\v38\\python.exe is 32-bit, but Julia is 64-bit")

As the error message says, your Python is 32-bit. You can’t link 32-bit Python to 64-bit Julia.

could you try this? @fhkm

ENV[“PYTHON”] = “D://programs//python//v38//python.exe”

the day before yesterday I again worked with PyCall, and this problem occurred once again, IIRC.

Yes, I tried that. It did not work.

I merged the two threads. You have two choices:

  1. If you want to use a pre-existing/manual Python installation via ENV["PYTHON"], then you need to install a 64-bit Python for a 64-bit Julia, or switch to a 32-bit Julia to link to a 32-bit Python.

  2. If you want Julia to install its own Miniconda distro, you have to resolve the download failure. As I noted above, this is most likely some kind of firewall misconfiguration.

1 Like

Steven,
Thanks.

  1. I force Julia v1.4 to use the installed Python 64-bit version.
  2. I added Matplotlib to the installed Python (64-bit)
  3. Add the command using Pkg;Pkg.build("PyCall")

Now, I am able to use PyCall and PyPlot on my windows 7 x64.
Thanks for your time.