【发布时间】:2020-12-08 20:05:28
【问题描述】:
我是 Julia 的新手。我正在尝试使用
导入“PyPlot”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\Carlos\.julia\packages\PyCall\BcTLp\src\startup
.jl:44
[3] include(::Function, ::Module, ::String) at .\Base.jl:380
[4] include at .\Base.jl:368 [inlined]
[5] include(::String) at C:\Users\Carlos\.julia\packages\PyCall\BcTLp\src\PyCal
l.jl:1
[6] top-level scope at C:\Users\Carlos\.julia\packages\PyCall\BcTLp\src\PyCall.
jl:38
[7] include(::Function, ::Module, ::String) at .\Base.jl:380
[8] include(::Module, ::String) at .\Base.jl:368
[9] top-level scope at none:2
[10] eval at .\boot.jl:331 [inlined]
[11] eval(::Expr) at .\client.jl:467
[12] top-level scope at .\none:3
in expression starting at C:\Users\Carlos\.julia\packages\PyCall\BcTLp\src\start
up.jl:41
in expression starting at C:\Users\Carlos\.julia\packages\PyCall\BcTLp\src\PyCal
l.jl:38
ERROR: LoadError: Failed to precompile PyCall [438e738f-606a-5dbb-bf0a-cddfbfd45
ab0] to C:\Users\Carlos\.julia\compiled\v1.5\PyCall\GkzkC_NvSXt.ji.
Stacktrace:
[1] error(::String) at .\error.jl:33
[2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1290
[3] _require(::Base.PkgId) at .\loading.jl:1030
[4] require(::Base.PkgId) at .\loading.jl:928
[5] require(::Module, ::Symbol) at .\loading.jl:923
[6] include(::Function, ::Module, ::String) at .\Base.jl:380
[7] include(::Module, ::String) at .\Base.jl:368
[8] top-level scope at none:2
[9] eval at .\boot.jl:331 [inlined]
[10] eval(::Expr) at .\client.jl:467
[11] top-level scope at .\none:3
in expression starting at C:\Users\Carlos\.julia\packages\PyPlot\XHEG0\src\PyPlo
t.jl:4
ERROR: Failed to precompile PyPlot [d330b81b-6aea-500a-939a-2ce795aea3ee] to C:\
Users\Carlos\.julia\compiled\v1.5\PyPlot\oatAj_NvSXt.ji.
Stacktrace:
[1] error(::String) at .\error.jl:33
[2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1290
[3] _require(::Base.PkgId) at .\loading.jl:1030
[4] require(::Base.PkgId) at .\loading.jl:928
[5] require(::Module, ::Symbol) at .\loading.jl:923
当我使用Pkg.build("PyCall") 时,我收到以下错误:
julia> Pkg.build("PyCall")
Building Conda ─→ `C:\Users\Carlos\.julia\packages\Conda\x5ml4\deps\build.log
`
Building PyCall → `C:\Users\Carlos\.julia\packages\PyCall\BcTLp\deps\build.lo
g`
┌ 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.ServicePoin
tManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; (New-Obj
ect System.Net.Webclient).DownloadFile('https://repo.continuum.io/miniconda/Mini
conda3-latest-Windows-x86_64.exe', 'C:\Users\Carlos\.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\Carlos\.julia\packages\Conda
\x5ml4\src\Conda.jl:166
│ [5] _install_conda(::String) at C:\Users\Carlos\.julia\packages\Conda\x5ml4\s
rc\Conda.jl:157
│ [6] runconda(::Cmd, ::String) at C:\Users\Carlos\.julia\packages\Conda\x5ml4\
src\Conda.jl:114
│ [7] add(::String, ::String; channel::String) at C:\Users\Carlos\.julia\packag
es\Conda\x5ml4\src\Conda.jl:190
│ [8] add at C:\Users\Carlos\.julia\packages\Conda\x5ml4\src\Conda.jl:189 [inli
ned] (repeats 2 times)
│ [9] top-level scope at C:\Users\Carlos\.julia\packages\PyCall\BcTLp\deps\buil
d.jl:84
│ [10] include(::String) at .\client.jl:457
│ [11] top-level scope at none:5
│ in expression starting at C:\Users\Carlos\.julia\packages\PyCall\BcTLp\deps\bu
ild.jl:43
└ @ Pkg.Operations D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib
\v1.5\Pkg\src\Operations.jl:942
我尝试了几种不同的解决方案,这些解决方案在不同的论坛(包括 StackOverflow)中找到,但这些解决方案似乎不适用于我的具体情况。似乎与防病毒/防火墙问题无关。
另外,问题出在 PyCall 而不是 PyPlot 上。
有人知道在这里做什么吗?
谢谢。
【问题讨论】:
-
当您按照错误消息中的第一个建议并运行
Pkg.build("PyCall")时会发生什么? (这也需要using Pkg)。 -
@Przemyslaw Szufel 完成。我用
Pkg.build("PyCall")的输出编辑了我的问题,这也给了我一个错误。
标签: python matplotlib error-handling package julia