shg / ob-julia-vterm.el

Org-babel support for Julia code blocks using julia-vterm
GNU General Public License v3.0
36 stars 6 forks source link

Packages won't load #3

Closed idontgetoutmuch closed 2 years ago

idontgetoutmuch commented 3 years ago

I tried

#+BEGIN_SRC julia-vterm :session :output
using Distributions
#+END_SRC

but get

[ Info: Precompiling Distributions [31c24e10-a181-5473-b8eb-7969acd0382f]
ERROR: LoadError: ArgumentError: Package Rmath_jll [f50d1b31-88e8-58de-be2c-1cc44531875f] is required but does not seem to be installed:
 - Run `Pkg.instantiate()` to install all recorded dependencies.

Stacktrace:
 [1] _require(::Base.PkgId) at /nix/store/0rzd268648bbfhkwvpqs27zjv63z1pzh-julia-1.5.3/lib/julia/sys.dylib:?
 [2] require(::Base.PkgId) at /nix/store/0rzd268648bbfhkwvpqs27zjv63z1pzh-julia-1.5.3/lib/julia/sys.dylib:? (repeats 2 times)
 [3] include(::Function, ::Module, ::String) at /nix/store/0rzd268648bbfhkwvpqs27zjv63z1pzh-julia-1.5.3/lib/julia/sys.dylib:? (repeats 2 times)
 [4] top-level scope at none:2
 [5] eval at ./boot.jl:331 [inlined]
 [6] eval(::Expr) at ./client.jl:467
 [7] top-level scope at ./none:3
in expression starting at /nix/store/jmi07zhnpmnphnw3ls0cxmrq1n89spbd-julia-depot/packages/Rmath/lo1Ao/src/Rmath.jl:7
ERROR: LoadError: LoadError: Failed to precompile Rmath [79098fc4-a85e-5d69-aa6a-4863f24498fa] to /Users/dom/.julia/compiled/v1.5/Rmath/0iTqX_buGQe.ji.
Stacktrace:
 [1] error(::String) at /nix/store/0rzd268648bbfhkwvpqs27zjv63z1pzh-julia-1.5.3/lib/julia/sys.dylib:?
 [2] compilecache(::Base.PkgId, ::String) at /nix/store/0rzd268648bbfhkwvpqs27zjv63z1pzh-julia-1.5.3/lib/julia/sys.dylib:?
 [3] _require(::Base.PkgId) at /nix/store/0rzd268648bbfhkwvpqs27zjv63z1pzh-julia-1.5.3/lib/julia/sys.dylib:?
 [4] require(::Base.PkgId) at /nix/store/0rzd268648bbfhkwvpqs27zjv63z1pzh-julia-1.5.3/lib/julia/sys.dylib:? (repeats 2 times)
 [5] include(::Function, ::Module, ::String) at /nix/store/0rzd268648bbfhkwvpqs27zjv63z1pzh-julia-1.5.3/lib/julia/sys.dylib:?
 [6] include at ./Base.jl:368 [inlined]
 [7] include(::String) at /nix/store/jmi07zhnpmnphnw3ls0cxmrq1n89spbd-julia-depot/packages/StatsFuns/zJ1EI/src/StatsFuns.jl:3
 [8] top-level scope at /nix/store/jmi07zhnpmnphnw3ls0cxmrq1n89spbd-julia-depot/packages/StatsFuns/zJ1EI/src/StatsFuns.jl:241
 [9] include(::Function, ::Module, ::String) at /nix/store/0rzd268648bbfhkwvpqs27zjv63z1pzh-julia-1.5.3/lib/julia/sys.dylib:? (repeats 2 times)
 [10] top-level scope at none:2
 [11] eval at ./boot.jl:331 [inlined]
 [12] eval(::Expr) at ./client.jl:467
 [13] top-level scope at ./none:3
in expression starting at /nix/store/jmi07zhnpmnphnw3ls0cxmrq1n89spbd-julia-depot/packages/StatsFuns/zJ1EI/src/rmath.jl:5
in expression starting at /nix/store/jmi07zhnpmnphnw3ls0cxmrq1n89spbd-julia-depot/packages/StatsFuns/zJ1EI/src/StatsFuns.jl:241
ERROR: LoadError: Failed to precompile StatsFuns [4c63d2b9-4356-54db-8cca-17b64c39e42c] to /Users/dom/.julia/compiled/v1.5/StatsFuns/530lR_buGQe.ji.
Stacktrace:
 [1] error(::String) at /nix/store/0rzd268648bbfhkwvpqs27zjv63z1pzh-julia-1.5.3/lib/julia/sys.dylib:?
 [2] compilecache(::Base.PkgId, ::String) at /nix/store/0rzd268648bbfhkwvpqs27zjv63z1pzh-julia-1.5.3/lib/julia/sys.dylib:?
 [3] _require(::Base.PkgId) at /nix/store/0rzd268648bbfhkwvpqs27zjv63z1pzh-julia-1.5.3/lib/julia/sys.dylib:?
 [4] require(::Base.PkgId) at /nix/store/0rzd268648bbfhkwvpqs27zjv63z1pzh-julia-1.5.3/lib/julia/sys.dylib:? (repeats 2 times)
 [5] include(::Function, ::Module, ::String) at /nix/store/0rzd268648bbfhkwvpqs27zjv63z1pzh-julia-1.5.3/lib/julia/sys.dylib:? (repeats 2 times)
 [6] top-level scope at none:2
 [7] eval at ./boot.jl:331 [inlined]
 [8] eval(::Expr) at ./client.jl:467
 [9] top-level scope at ./none:3
in expression starting at /nix/store/jmi07zhnpmnphnw3ls0cxmrq1n89spbd-julia-depot/packages/Distributions/HjzA0/src/Distributions.jl:3
ERROR: LoadError: Failed to precompile Distributions [31c24e10-a181-5473-b8eb-7969acd0382f] to /Users/dom/.julia/compiled/v1.5/Distributions/xILW0_buGQe.ji.
Stacktrace:
 [1] error(::String) at /nix/store/0rzd268648bbfhkwvpqs27zjv63z1pzh-julia-1.5.3/lib/julia/sys.dylib:?
 [2] compilecache(::Base.PkgId, ::String) at /nix/store/0rzd268648bbfhkwvpqs27zjv63z1pzh-julia-1.5.3/lib/julia/sys.dylib:?
 [3] _require(::Base.PkgId) at /nix/store/0rzd268648bbfhkwvpqs27zjv63z1pzh-julia-1.5.3/lib/julia/sys.dylib:?
 [4] require(::Base.PkgId) at /nix/store/0rzd268648bbfhkwvpqs27zjv63z1pzh-julia-1.5.3/lib/julia/sys.dylib:? (repeats 2 times)
 [5] top-level scope at /var/folders/h1/bkwn2ct12hvb6__dzrk5gwx80000gn/T/babel-CmCujk/julia-vterm-src-JaPyeZ:2
 [6] include(::String) at ./client.jl:457
 [7] top-level scope at REPL[7]:1
in expression starting at /var/folders/h1/bkwn2ct12hvb6__dzrk5gwx80000gn/T/babel-CmCujk/julia-vterm-src-JaPyeZ:1
julia> ENV
Base.EnvDict with 110 entries:
  "HOST_PATH"                    => "/nix/store/vkj3b9mpy8dk059xw5x6hn7adljn8vb0-julia-env/bin:/…  "IN_LORRI_SHELL"               => "/Users/dom/Dropbox/Tidy/lorri-test/shell.nix"
  "origOutputs"                  => "out"
  "propagatedBuildInputs"        => ""
  "stdenv"                       => "/nix/store/nxnzafl96xx78qz905p5jp6irc9ck942-stdenv-darwin"
  "LANG"                         => "en_GB.UTF-8"
  "XPC_FLAGS"                    => "0x0"
  "DISPLAY"                      => "/private/tmp/com.apple.launchd.O47r5J4jtP/org.macosforge.xq…  "DIRENV_DIR"                   => "-/Users/dom/Dropbox/Tidy/lorri-test"
  "JULIA_DEPOT_PATH"             => "/Users/dom/.julia:/nix/store/jmi07zhnpmnphnw3ls0cxmrq1n89sp…  "COMMAND_MODE"                 => "unix2003"
  "origPATH"                     => ""
  "out"                          => "/nix/store/ayavlxqxyhq7qpsgdbwh9p7k6cinym3y-lorri-keep-env-…  "NIX_NO_SELF_RPATH"            => "1"
  "origExtraClosure"             => ""
  "origArgs"                     => "-e /nix/store/9krlzvny65gdc8s7kpb6lkx8cd02c25b-default-buil…  "__CF_USER_TEXT_ENCODING"      => "0x1F5:0x0:0x2"
  "CONFIG_SHELL"                 => "/nix/store/rq1inyhyr4gddgc5gxdid38iwn7769d7-bash-4.4-p23/bi…  "buildInputs"                  => "/nix/store/vkj3b9mpy8dk059xw5x6hn7adljn8vb0-julia-env /nix/…  "DIRENV_DIFF"                  => "eJzsWVlv47iW_iuGXju0tS8ZzINjK4krXlK2U5UqFCBQpBZaG03K2i76vw8…  "INSIDE_EMACS"                 => "vterm"
  "MallocSpaceEfficient"         => "1"
  "builder"                      => "/nix/store/hwbjslm06r9dgk0gdl0v7lhwr9in7dak-lorri-runtime-t…  "SSH_AUTH_SOCK"                => "/private/tmp/com.apple.launchd.UMWORxjt5S/Listeners"
  "extraClosure"                 => "/nix/store/1r1x8zvw0szgcs1i8gyfzgrxwi053pk3-libc++-7.1.0 /n…  "NIX_DONT_SET_RPATH_FOR_BUILD" => "1"
  "CC"                           => "clang"
  "USER"                         => "dom"
  "NIX_DONT_SET_RPATH"           => "1"
  ⋮                              => ⋮

But it is precompiled

  /nix/store/jmi07zhnpmnphnw3ls0cxmrq1n89spbd-julia-depot/compiled/v1.5/Distributions/xILW0_9igGY.ji

and I can use it in a regular julia shell.

shg commented 3 years ago

Sorry for the delayed response. The same code works here.

What the error message says is that Julia can't find Rmath_jll which Distributions depends on. Did you try Pkg.instantiate() as described in the message? You may have outdated Manifest.toml and in that case you may need to Pkg.resolve() before instantiate.

shg commented 2 years ago

Close this as it was probably not an ob-julia-vterm issue.