When I try to compile my Julia file in a Julia command prompt, as so :
julia> include("file.jl")
it shows me this error, which I can't wrap my head around :
[ Info: Precompiling PyPlot [d330b81b-6aea-500a-939a-2ce795aea3ee]
ERROR: LoadError: LoadError: could not load library "/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0"
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0: wrong ELF class: ELFCLASS64
Stacktrace:
[1] dlopen(::String, ::UInt32) at /buildworker/worker/package_linux32/build/usr/share/julia/stdlib/v1.0/Libdl/src/Libdl.jl:97
[2] top-level scope at /home/toto/.julia/packages/PyCall/zqDXB/src/startup.jl:47 [inlined]
[3] top-level scope at ./none:0
[4] include at ./boot.jl:317 [inlined]
[5] include_relative(::Module, ::String) at ./loading.jl:1044
[6] include at ./sysimg.jl:29 [inlined]
[7] include(::String) at /home/toto/.julia/packages/PyCall/zqDXB/src/PyCall.jl:1
[8] top-level scope at none:0
[9] include at ./boot.jl:317 [inlined]
[10] include_relative(::Module, ::String) at ./loading.jl:1044
[11] include(::Module, ::String) at ./sysimg.jl:29
[12] top-level scope at none:2
[13] eval at ./boot.jl:319 [inlined]
[14] eval(::Expr) at ./client.jl:393
[15] top-level scope at ./none:3
in expression starting at /home/toto/.julia/packages/PyCall/zqDXB/src/startup.jl:41
in expression starting at /home/toto/.julia/packages/PyCall/zqDXB/src/PyCall.jl:34
ERROR: LoadError: Failed to precompile PyCall [438e738f-606a-5dbb-bf0a-cddfbfd45ab0] to /home/toto/.julia/compiled/v1.0/PyCall/GkzkC.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1203
[3] _require(::Base.PkgId) at ./loading.jl:960
[4] require(::Base.PkgId) at ./loading.jl:858
[5] require(::Module, ::Symbol) at ./loading.jl:853
[6] include at ./boot.jl:317 [inlined]
[7] include_relative(::Module, ::String) at ./loading.jl:1044
[8] include(::Module, ::String) at ./sysimg.jl:29
[9] top-level scope at none:2
[10] eval at ./boot.jl:319 [inlined]
[11] eval(::Expr) at ./client.jl:393
[12] top-level scope at ./none:3
in expression starting at /home/toto/.julia/packages/PyPlot/XHEG0/src/PyPlot.jl:4
ERROR: LoadError: LoadError: LoadError: Failed to precompile PyPlot [d330b81b-6aea-500a-939a-2ce795aea3ee] to /home/toto/.julia/compiled/v1.0/PyPlot/oatAj.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1203
[3] _require(::Base.PkgId) at ./loading.jl:960
[4] require(::Base.PkgId) at ./loading.jl:858
[5] require(::Module, ::Symbol) at ./loading.jl:853
[6] include at ./boot.jl:317 [inlined]
[7] include_relative(::Module, ::String) at ./loading.jl:1044
[8] include(::Module, ::String) at ./sysimg.jl:29
[9] include(::String) at ./client.jl:392
[10] top-level scope at none:0
[11] include at ./boot.jl:317 [inlined]
[12] include_relative(::Module, ::String) at ./loading.jl:1044
[13] include(::Module, ::String) at ./sysimg.jl:29
[14] include(::String) at ./client.jl:392
[15] top-level scope at none:0
[16] include at ./boot.jl:317 [inlined]
[17] include_relative(::Module, ::String) at ./loading.jl:1044
[18] include(::Module, ::String) at ./sysimg.jl:29
[19] include(::String) at ./client.jl:392
[20] top-level scope at none:0
in expression starting at /home/toto/project/code/julia/file3.jl:1
in expression starting at /home/toto/project/code/julia/file2.jl:2
in expression starting at /home/toto/project/code/julia/file.jl:1
How do I solve this? I note that I have installed PyPlot :
julia> import Pkg; Pkg.add("PyPlot")
Resolving package versions...
Updating `~/.julia/environments/v1.0/Project.toml`
[no changes]
Updating `~/.julia/environments/v1.0/Manifest.toml`
[no changes]
I also note that I am getting this error in a second Julia command window using Juno, since Juno's standard REPL is occupied running some other code. This other code in REPL includes my "faulty" files file.jl, file2.jl
and file3.jl
as well, and runs just fine there.
The problem solved itself after I tried to open a second REPL by clicking in the menu bar Juno -> Open External REPL
, instead of my initial Juno -> New Terminal -> Current File's Folder
.