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

**URL:** <https://discourse.julialang.org/t/v1-4-failed-to-precompile-pycall-and-pyplot-on-windows-7-x64/37718>\
**Category:** General Usage\
**Tags:** question, plotting\
**Created:** [April 16, 2020, 10:02pm UTC](https://discourse.julialang.org/t/v1-4-failed-to-precompile-pycall-and-pyplot-on-windows-7-x64/37718 "2020-04-16T22:02:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![fhkm](https://avatars.discourse-cdn.com/v4/letter/f/b19c9b/32.png) [@fhkm](https://discourse.julialang.org/u/fhkm)\
**Post date:** [April 16, 2020, 10:02pm UTC](https://discourse.julialang.org/t/v1-4-failed-to-precompile-pycall-and-pyplot-on-windows-7-x64/37718/1 "2020-04-16T22:02:19Z")

</div>

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

---

<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:** [April 16, 2020, 10:28pm UTC](https://discourse.julialang.org/t/v1-4-failed-to-precompile-pycall-and-pyplot-on-windows-7-x64/37718/2 "2020-04-16T22:28:58Z")

</div>

Downloading miniconda failed — note the error message says that

```nohighlight
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?

---

<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:** [April 17, 2020, 12:37am UTC](https://discourse.julialang.org/t/v1-4-failed-to-precompile-pycall-and-pyplot-on-windows-7-x64/37718/4 "2020-04-17T00:37:01Z")

</div>

A post was merged into an existing topic: [Why cannot Julia v1.4 find the installed Python?](https://discourse.julialang.org/t/why-cannot-julia-v1-4-find-the-installed-python/37726/3)

---

<div class="post-metadata">

**Author:** ![fhkm](https://avatars.discourse-cdn.com/v4/letter/f/b19c9b/32.png) [@fhkm](https://discourse.julialang.org/u/fhkm)\
**Post date:** [April 17, 2020, 1:08am UTC](https://discourse.julialang.org/t/v1-4-failed-to-precompile-pycall-and-pyplot-on-windows-7-x64/37718/6 "2020-04-17T01:08:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![fhkm](https://avatars.discourse-cdn.com/v4/letter/f/b19c9b/32.png) [@fhkm](https://discourse.julialang.org/u/fhkm)\
**Post date:** [April 17, 2020, 12:17am UTC](https://discourse.julialang.org/t/v1-4-failed-to-precompile-pycall-and-pyplot-on-windows-7-x64/37718/7 "2020-04-17T00:17:08Z")

</div>

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
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

```

---

<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:** [April 17, 2020, 12:27am UTC](https://discourse.julialang.org/t/v1-4-failed-to-precompile-pycall-and-pyplot-on-windows-7-x64/37718/8 "2020-04-17T00:27:34Z")

</div>

> `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.

---

<div class="post-metadata">

**Author:** ![thautwarm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thautwarm/32/37760_2.png) [@thautwarm](https://discourse.julialang.org/u/thautwarm)\
**Post date:** [April 17, 2020, 12:37am UTC](https://discourse.julialang.org/t/v1-4-failed-to-precompile-pycall-and-pyplot-on-windows-7-x64/37718/10 "2020-04-17T00:37:05Z")

</div>

could you try this? @fhkm

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

```

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

---

<div class="post-metadata">

**Author:** ![fhkm](https://avatars.discourse-cdn.com/v4/letter/f/b19c9b/32.png) [@fhkm](https://discourse.julialang.org/u/fhkm)\
**Post date:** [April 17, 2020, 12:37am UTC](https://discourse.julialang.org/t/v1-4-failed-to-precompile-pycall-and-pyplot-on-windows-7-x64/37718/11 "2020-04-17T00:37:39Z")

</div>

Yes, I tried that. It did 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:** [April 17, 2020, 2:04am UTC](https://discourse.julialang.org/t/v1-4-failed-to-precompile-pycall-and-pyplot-on-windows-7-x64/37718/13 "2020-04-17T02:04:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![fhkm](https://avatars.discourse-cdn.com/v4/letter/f/b19c9b/32.png) [@fhkm](https://discourse.julialang.org/u/fhkm)\
**Post date:** [April 17, 2020, 4:38am UTC](https://discourse.julialang.org/t/v1-4-failed-to-precompile-pycall-and-pyplot-on-windows-7-x64/37718/14 "2020-04-17T04:38:07Z")

</div>

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.
