# Weird problem: Symbolics crashes on first import then works on second

**URL:** <https://discourse.julialang.org/t/weird-problem-symbolics-crashes-on-first-import-then-works-on-second/118633>\
**Category:** General Usage\
**Tags:** stacktrace, symbolics, crash\
**Created:** [August 26, 2024, 4:57pm UTC](https://discourse.julialang.org/t/weird-problem-symbolics-crashes-on-first-import-then-works-on-second/118633 "2024-08-26T16:57:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AronT](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aront/32/24890_2.png) [@AronT](https://discourse.julialang.org/u/AronT)\
**Post date:** [August 26, 2024, 4:57pm UTC](https://discourse.julialang.org/t/weird-problem-symbolics-crashes-on-first-import-then-works-on-second/118633/1 "2024-08-26T16:57:06Z")

</div>

I just start playing around with _Symbolics_. Great package! So I added it using _pkg_ and now every time I enter the REPL and issue the command _using Symbolics_ the first time round I get the stack trace below. And even though it tells me to _instantiate_ the project I don’t really have to. I just need to run _using Symbolics_ one more time and it works great. What am I missing here?

PS as you can see in the stack trace I am using Julia 1.10.4+0.aarch64.apple.darwin14

> julia\> using Symbolics  
> ┌ Error: Error during loading of extension TestExt of TranscodingStreams, use `Base.retry_load_extensions()` to retry.  
> │ exception =  
> │ 1-element ExceptionStack:  
> │ ArgumentError: Package TestExt [29286dec-c893-52d1-88fe-e07e79eb4405] is required but does not seem to be installed:  
> │ - Run `Pkg.instantiate()` to install all recorded dependencies.  
> │  
> │ Stacktrace:  
> │ [1] \_require(pkg::Base.PkgId, env::Nothing)  
> │ @ Base ./loading.jl:1926  
> │ [2] \_\_require\_prelocked(uuidkey::Base.PkgId, env::Nothing)  
> │ @ Base ./loading.jl:1812  
> │ [3] #invoke\_in\_world#3  
> │ @ ./essentials.jl:926 [inlined]  
> │ [4] invoke\_in\_world  
> │ @ ./essentials.jl:923 [inlined]  
> │ [5] \_require\_prelocked  
> │ @ ./loading.jl:1803 [inlined]  
> │ [6] \_require\_prelocked  
> │ @ ./loading.jl:1802 [inlined]  
> │ [7] run\_extension\_callbacks(extid::Base.ExtensionId)  
> │ @ Base ./loading.jl:1295  
> │ [8] run\_extension\_callbacks(pkgid::Base.PkgId)  
> │ @ Base ./loading.jl:1330  
> │ [9] run\_package\_callbacks(modkey::Base.PkgId)  
> │ @ Base ./loading.jl:1164  
> │ [10] \_tryrequire\_from\_serialized(modkey::Base.PkgId, path::String, ocachepath::String, sourcepath::String, depmods::Vector{Any})  
> │ @ Base ./loading.jl:1487  
> │ [11] \_require\_search\_from\_serialized(pkg::Base.PkgId, sourcepath::String, build\_id::UInt128)  
> │ @ Base ./loading.jl:1574  
> │ [12] \_require(pkg::Base.PkgId, env::String)  
> │ @ Base ./loading.jl:1938  
> │ [13] \_\_require\_prelocked(uuidkey::Base.PkgId, env::String)  
> │ @ Base ./loading.jl:1812  
> │ [14] #invoke\_in\_world#3  
> │ @ ./essentials.jl:926 [inlined]  
> │ [15] invoke\_in\_world  
> │ @ ./essentials.jl:923 [inlined]  
> │ [16] \_require\_prelocked(uuidkey::Base.PkgId, env::String)  
> │ @ Base ./loading.jl:1803  
> │ [17] macro expansion  
> │ @ ./loading.jl:1790 [inlined]  
> │ [18] macro expansion  
> │ @ ./lock.jl:267 [inlined]  
> │ [19] \_\_require(into::Module, mod::Symbol)  
> │ @ Base ./loading.jl:1753  
> │ [20] #invoke\_in\_world#3  
> │ @ ./essentials.jl:926 [inlined]  
> │ [21] invoke\_in\_world  
> │ @ ./essentials.jl:923 [inlined]  
> │ [22] require(into::Module, mod::Symbol)  
> │ @ Base ./loading.jl:1746  
> │ [23] eval  
> │ @ ./boot.jl:385 [inlined]  
> │ [24] eval\_user\_input(ast::Any, backend::REPL.REPLBackend, mod::Module)  
> │ @ REPL ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:150  
> │ [25] repl\_backend\_loop(backend::REPL.REPLBackend, get\_module::Function)  
> │ @ REPL ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:246  
> │ [26] start\_repl\_backend(backend::REPL.REPLBackend, consumer::Any; get\_module::Function)  
> │ @ REPL ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:231  
> │ [27] run\_repl(repl::REPL.AbstractREPL, consumer::Any; backend\_on\_current\_task::Bool, backend::Any)  
> │ @ REPL ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:389  
> │ [28] run\_repl(repl::REPL.AbstractREPL, consumer::Any)  
> │ @ REPL ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/REPL.jl:375  
> │ [29] (::Base.var"#1013#1015"{Bool, Bool, Bool})(REPL::Module)  
> │ @ Base ./client.jl:432  
> │ [30] #invokelatest#2  
> │ @ ./essentials.jl:892 [inlined]  
> │ [31] invokelatest  
> │ @ ./essentials.jl:889 [inlined]  
> │ [32] run\_main\_repl(interactive::Bool, quiet::Bool, banner::Bool, history\_file::Bool, color\_set::Bool)  
> │ @ Base ./client.jl:416  
> │ [33] exec\_options(opts::Base.JLOptions)  
> │ @ Base ./client.jl:333  
> │ [34] \_start()  
> │ @ Base ./client.jl:552  
> └ @ Base loading.jl:1301

---

<div class="post-metadata">

**Author:** ![BioTurboNick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bioturbonick/32/6380_2.png) [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)\
**Post date:** [August 26, 2024, 8:03pm UTC](https://discourse.julialang.org/t/weird-problem-symbolics-crashes-on-first-import-then-works-on-second/118633/2 "2024-08-26T20:03:42Z")

</div>

Symbolics isn’t crashing per se, but some other package loaded during loading of Symbolics is causing an error. You often won’t get loading errors a second time in the same session. So something is broken, but maybe something ancillary.

Looks like something in the dependency chain for Symbolics depends on Test, for some reason, and TranscodingStreams has a package extension for Test, for some reason. So loading Test as part of Symbolics tries to load the TranscodingStreams extension for Test, but that fails.

```julia
(@v1.10) pkg> why Test
  Symbolics → DynamicPolynomials → MultivariatePolynomials → MutableArithmetics → Test
  Symbolics → DynamicPolynomials → MutableArithmetics → Test
  Symbolics → DynamicPolynomials → Test
  Symbolics → SciMLBase → Accessors → Test
  Symbolics → SciMLBase → RecursiveArrayTools → SymbolicIndexingInterface → Accessors → Test
  Symbolics → SciMLBase → SymbolicIndexingInterface → Accessors → Test
  Symbolics → SymbolicIndexingInterface → Accessors → Test
  Symbolics → SymbolicLimits → SymbolicUtils → DynamicPolynomials → MultivariatePolynomials → MutableArithmetics → Test
  Symbolics → SymbolicLimits → SymbolicUtils → DynamicPolynomials → MutableArithmetics → Test
  Symbolics → SymbolicLimits → SymbolicUtils → DynamicPolynomials → Test
  Symbolics → SymbolicLimits → SymbolicUtils → MultivariatePolynomials → MutableArithmetics → Test
  Symbolics → SymbolicLimits → SymbolicUtils → SymbolicIndexingInterface → Accessors → Test
  Symbolics → SymbolicUtils → DynamicPolynomials → MultivariatePolynomials → MutableArithmetics → Test
  Symbolics → SymbolicUtils → DynamicPolynomials → MutableArithmetics → Test
  Symbolics → SymbolicUtils → DynamicPolynomials → Test
  Symbolics → SymbolicUtils → MultivariatePolynomials → MutableArithmetics → Test
  Symbolics → SymbolicUtils → SymbolicIndexingInterface → Accessors → Test

```

I think there was just a gripe somewhere about removing dependencies on Test from the General registry…

But if you remove TranscodingStreams, I think your error will go away. Or maybe that’s where a bug report should go?

---

<div class="post-metadata">

**Author:** ![nhz2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nhz2/32/44428_2.png) [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Post date:** [August 26, 2024, 8:29pm UTC](https://discourse.julialang.org/t/weird-problem-symbolics-crashes-on-first-import-then-works-on-second/118633/3 "2024-08-26T20:29:48Z")

</div>

I removed the TestExt of TranscodingStreams in [remove TestExt.jl by nhz2 · Pull Request #238 · JuliaIO/TranscodingStreams.jl · GitHub](https://github.com/JuliaIO/TranscodingStreams.jl/pull/238)

I think the issue is you are using an old version of TranscodingStreams for some reason.

What does:

```julia
using Pkg
pkg"status --outdated -m"

```

show?

---

<div class="post-metadata">

**Author:** ![AronT](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aront/32/24890_2.png) [@AronT](https://discourse.julialang.org/u/AronT)\
**Post date:** [August 27, 2024, 2:27pm UTC](https://discourse.julialang.org/t/weird-problem-symbolics-crashes-on-first-import-then-works-on-second/118633/4 "2024-08-27T14:27:15Z")

</div>

I deleted my `Manifest.toml` and compiled cache. I then reinstantiated and recompiled everything and now it works fine! Thanks for the help. BTW the trick I learned from  
this & another issue I had is you need to delete your Manifest file and reinstantiate. Cleaning the cache is not sufficient to solve problems like these! In the future I will do that before posting here. Hopefully others can learn from this so I wouldn’t have wasted others valuable time!

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [August 27, 2024, 2:39pm UTC](https://discourse.julialang.org/t/weird-problem-symbolics-crashes-on-first-import-then-works-on-second/118633/5 "2024-08-27T14:39:04Z")

</div>

Yeah part of this is that we just need v1.11 to come out for v1.10 to be the new LTS, and then everyone needs to make Test an extension library. We need to clean up the whole ecosystem, and if anyone wants to help please help clean those.

> [@BioTurboNick](#):
>
> ```julia
> (@v1.10) pkg> why Test
> Symbolics → DynamicPolynomials → MultivariatePolynomials → MutableArithmetics → Test
> Symbolics → DynamicPolynomials → MutableArithmetics → Test
> Symbolics → DynamicPolynomials → Test
> Symbolics → SciMLBase → Accessors → Test
> Symbolics → SciMLBase → RecursiveArrayTools → SymbolicIndexingInterface → Accessors → Test
> Symbolics → SciMLBase → SymbolicIndexingInterface → Accessors → Test
> Symbolics → SymbolicIndexingInterface → Accessors → Test
> Symbolics → SymbolicLimits → SymbolicUtils → DynamicPolynomials → MultivariatePolynomials → MutableArithmetics → Test
> Symbolics → SymbolicLimits → SymbolicUtils → DynamicPolynomials → MutableArithmetics → Test
> Symbolics → SymbolicLimits → SymbolicUtils → DynamicPolynomials → Test
> Symbolics → SymbolicLimits → SymbolicUtils → MultivariatePolynomials → MutableArithmetics → Test
> Symbolics → SymbolicLimits → SymbolicUtils → SymbolicIndexingInterface → Accessors → Test
> Symbolics → SymbolicUtils → DynamicPolynomials → MultivariatePolynomials → MutableArithmetics → Test
> Symbolics → SymbolicUtils → DynamicPolynomials → MutableArithmetics → Test
> Symbolics → SymbolicUtils → DynamicPolynomials → Test
> Symbolics → SymbolicUtils → MultivariatePolynomials → MutableArithmetics → Test
> Symbolics → SymbolicUtils → SymbolicIndexingInterface → Accessors → Test
> 
> ```

Such junk, all of those libraries need a PR.
