Getting IJulia to work inside of a mamba venv

anon56682678
Thu, 29 Jun 2023 13:47:19 +0000
General Usage

I am having trouble installing IJulia in Julia 1.9.1 inside a mamba environment. The crux of the issue seems to be the compiler not being able to find MbedTLS even though it is installed

Looking for: ['mbedtls']

conda-forge/noarch                                  13.1MB @   4.4MB/s  3.4s
conda-forge/linux-64                                32.7MB @   4.2MB/s  8.9s

Pinned packages:
  - python 3.11.*


Transaction

  Prefix: /shares/teacher/users/student/mambaforge/envs/jenv

  All requested packages already installed

> Using Pkg
> Pkg.update()
>Pkg.add("IJulia") # this works fine
> Using IJulia # This does not

The error when running the above commands is:

MbedTLS [739be429-bea8-5141-9913-cc70e7f3736d]

Failed to precompile MbedTLS [739be429-bea8-5141-9913-cc70e7f3736d] to "/shares/teacher/users/student/mambaforge/envs/jenv/share/julia/compiled/v1.9/MbedTLS/jl_g7s41h".
ERROR: LoadError: InitError: could not load library "libmbedtls.so"
libmbedx509.so.4: cannot open shared object file: No such file or directory
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl ./libdl.jl:117
  [2] dlopen
    @ ./libdl.jl:116 [inlined]
  [3] dlopen(s::String)
    @ Base.Libc.Libdl ./libdl.jl:116
  [4] __init__()
    @ MbedTLS_jll ~/mambaforge/envs/jenv/share/julia/stdlib/v1.9/MbedTLS_jll/src/MbedTLS_jll.jl:42
  [5] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1115
  [6] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base ./loading.jl:1061
  [7] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base ./loading.jl:1506
  [8] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1783
  [9] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1660
 [10] macro expansion
    @ ./loading.jl:1648 [inlined]
 [11] macro expansion
    @ ./lock.jl:267 [inlined]
 [12] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1611
 [13] include
    @ ./Base.jl:457 [inlined]
 [14] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2045
 [15] top-level scope
    @ stdin:3
during initialization of module MbedTLS_jll
in expression starting at /shares/teacher/users/student/mambaforge/envs/jenv/share/julia/packages/MbedTLS/lqmet/src/MbedTLS.jl:1
in expression starting at stdin:3

IJulia [7073ff75-c697-5162-941a-fcdaad2a7d2a]

Failed to precompile IJulia [7073ff75-c697-5162-941a-fcdaad2a7d2a] to "/shares/teacher/users/student/mambaforge/envs/jenv/share/julia/compiled/v1.9/IJulia/jl_sxd2YS".
ERROR: LoadError: InitError: could not load library "libmbedtls.so"
libmbedx509.so.4: cannot open shared object file: No such file or directory
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl ./libdl.jl:117
  [2] dlopen
    @ ./libdl.jl:116 [inlined]
  [3] dlopen(s::String)
    @ Base.Libc.Libdl ./libdl.jl:116
  [4] __init__()
    @ MbedTLS_jll ~/mambaforge/envs/jenv/share/julia/stdlib/v1.9/MbedTLS_jll/src/MbedTLS_jll.jl:42
  [5] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1115
  [6] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base ./loading.jl:1061
  [7] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base ./loading.jl:1506
  [8] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1783
  [9] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1660
 [10] macro expansion
    @ ./loading.jl:1648 [inlined]
 [11] macro expansion
    @ ./lock.jl:267 [inlined]
 [12] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1611
 [13] include
    @ ./Base.jl:457 [inlined]
 [14] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
    @ Base ./loading.jl:2045
 [15] top-level scope
    @ stdin:3
during initialization of module MbedTLS_jll
in expression starting at /shares/teacher/users/student/mambaforge/envs/jenv/share/julia/packages/MbedTLS/lqmet/src/MbedTLS.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile MbedTLS [739be429-bea8-5141-9913-cc70e7f3736d] to "/shares/teacher/users/student/mambaforge/envs/jenv/share/julia/compiled/v1.9/MbedTLS/jl_TwrfV9".
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base ./loading.jl:2296
  [3] compilecache
    @ ./loading.jl:2163 [inlined]
  [4] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1805
  [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1660
  [6] macro expansion
    @ ./loading.jl:1648 [inlined]
  [7] macro expansion
    @ ./lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1611
  [9] include(mod::Module, _path::String)
    @ Base ./Base.jl:457
 [10] include(x::String)
    @ IJulia ~/mambaforge/envs/jenv/share/julia/packages/IJulia/Vo51o/src/IJulia.jl:33
 [11] top-level scope
    @ ~/mambaforge/envs/jenv/share/julia/packages/IJulia/Vo51o/src/IJulia.jl:309
 [12] include
    @ ./Base.jl:457 [inlined]
 [13] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2045
 [14] top-level scope
    @ stdin:3
in expression starting at /shares/teacher/users/student/mambaforge/envs/jenv/share/julia/packages/IJulia/Vo51o/src/hmac.jl:1
in expression starting at /shares/teacher/users/student/mambaforge/envs/jenv/share/julia/packages/IJulia/Vo51o/src/IJulia.jl:1
in expression starting at stdin:3

Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types ~/mambaforge/envs/jenv/share/julia/stdlib/v1.9/Pkg/src/Types.jl:69
 [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, timing::Bool, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
   @ Pkg.API ~/mambaforge/envs/jenv/share/julia/stdlib/v1.9/Pkg/src/API.jl:1581
 [3] precompile(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API ~/mambaforge/envs/jenv/share/julia/stdlib/v1.9/Pkg/src/API.jl:156
 [4] precompile(pkgs::Vector{Pkg.Types.PackageSpec})
   @ Pkg.API ~/mambaforge/envs/jenv/share/julia/stdlib/v1.9/Pkg/src/API.jl:145
 [5] precompile(; name::Nothing, uuid::Nothing, version::Nothing, url::Nothing, rev::Nothing, path::Nothing, mode::Pkg.Types.PackageMode, subdir::Nothing, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API ~/mambaforge/envs/jenv/share/julia/stdlib/v1.9/Pkg/src/API.jl:171
 [6] precompile()
   @ Pkg.API ~/mambaforge/envs/jenv/share/julia/stdlib/v1.9/Pkg/src/API.jl:162
 [7] top-level scope
   @ REPL[4]:1

I had a read/write error before this and that I was able debug to the png/svg issue!!! There are some older posts that suggested among other things deleting the logo for julia solves read/write issues. As bizarre as that was, I was able to solve it but this MbedTLS issue does not seem to have a whole lot of discussions behind it. If someone is familiar, could you help me get IJulia working?

5 posts - 2 participants