Issues Importing Turing Linux

New to Linux but familiar (enough) with Turing. Having an issue get Turing to run on Ubuntu. I’ve been able to run Turing in windows, but getting some errors I’ve never seen before now. Currently running Julia 1.4.0. Here’s the stacktrace.

import Turing
[ Info: Precompiling Turing [fce5fe82-541a-59a6-adf8-730c64b5f9a0]
WARNING: could not import MCMCChains.AbstractChains into Turing
ERROR: LoadError: LoadError: UndefVarError: AbstractChains not defined
 [1] include(::Module, ::String) at ./Base.jl:377
 [2] include(::String) at /home/datguy/.julia/packages/Turing/xFzfF/src/Turing.jl:1
 [3] top-level scope at /home/datguy/.julia/packages/Turing/xFzfF/src/Turing.jl:124
 [4] include(::Module, ::String) at ./Base.jl:377
 [5] top-level scope at none:2
 [6] eval at ./boot.jl:331 [inlined]
 [7] eval(::Expr) at ./client.jl:449
 [8] top-level scope at ./none:3
in expression starting at /home/datguy/.julia/packages/Turing/xFzfF/src/utilities/Utilities.jl:6
in expression starting at /home/datguy/.julia/packages/Turing/xFzfF/src/Turing.jl:124
ERROR: Failed to precompile Turing [fce5fe82-541a-59a6-adf8-730c64b5f9a0] to /home/datguy/.julia/compiled/v1.4/Turing/gm4QC_d3UFe.ji.
 [1] error(::String) at ./error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1272
 [3] _require(::Base.PkgId) at ./loading.jl:1029
 [4] require(::Base.PkgId) at ./loading.jl:927
 [5] require(::Module, ::Symbol) at ./loading.jl:922

Also running the latest version of Turing. Thanks!

Here’s a link to a relevent issue, but for your purposes, Turing is currently out of date because of some other package and needs to be updated to 0.10.1.

Some fixes:

  1. Run ]add Turing@0.10.1, which will give you a lot of red text and tell you which package(s) is keeping you from updating to the most recent version. You can remove these one by one and then keep trying to add Turing.
  2. Make a fresh version of your global environment by deleting both Project.toml and Manifest.toml (typically in ~/.julia/environments/v1.4) and start fresh by installing Turing first.
  3. Make a local environment with ] activate . and then add Turing, which will sandbox Turing.

Thanks for the help and for quick lesson. Totally worked and totally helps!

1 Like

No problem. Let us know if there’s anything else that’s fishy!

fix 1 worked for me. In my case, Turing was stuck at 0.7.1 and was giving precompilation errors. I had to remove SumOfSquares, which hasnt been updated in quite some time.