Julia 0.4.5:libz无法在Ubuntu上加载

时间:2016-09-08 23:29:38

标签: julia ubuntu-16.04 libz

当我尝试在Julia中使用请求时,输出了以下错误:

julia> using Requests
INFO: Precompiling module Requests...
ERROR: LoadError: LoadError: error compiling version: could not load library "libz"
libz: cannot open shared object file: No such file or directory
while loading /home/michael/.julia/v0.4/Libz/src/lowlevel.jl, in expression starting on line 110
while loading /home/michael/.julia/v0.4/Libz/src/Libz.jl, in expression starting on line 11
ERROR: LoadError: Failed to precompile Libz to /home/michael/.julia/lib/v0.4/Libz.ji
while loading /home/michael/.julia/v0.4/Requests/src/Requests.jl, in expression starting on line 27
ERROR: Failed to precompile Requests to /home/michael/.julia/lib/v0.4/Requests.ji
in compilecache at ./loading.jl:400

我对朱莉娅的知识不足以辨别究竟发生了什么,但这里是来自Libz.jl的代码(第11行)......

include("lowlevel.jl")

...来自lowlevel.jl(第103-110行)......

# Functions
# ---------

function version()
    return unsafe_string(ccall((:zlibVersion, zlib), Ptr{UInt8}, ()))
end

const zlib_version = version()

...来自Requests.jl(第27行)

using Libz

此问题在我删除然后重新安装的Libz,MbedTLS和Requests之后仍然存在,并且在我Pkg.update()之后重新启动了julia和我的计算机。有没有人精通朱莉娅知道如何解决这个问题?

1 个答案:

答案 0 :(得分:7)

根据Gnimuc K的评论和更多的研究:

sudo apt-get install zlib1g-dev

安装朱莉娅需要的zlib。一旦安装......

julia> Pkg.update()
julia> Pkg.build("Libz")

解决了所有问题。