I am trying to use the “Symbolics” package but when I have a program that consists only of the line “using Symbolics” I get the error -
WARNING: Method definition isapprox(IntervalSets.AbstractInterval{T} where T, IntervalSets.AbstractInterval{T} where T) in module IntervalSets at /home/brombo/.julia/packages/IntervalSets/viB6k/src/IntervalSets.jl:144 overwritten in module DomainSets at /home/brombo/.julia/packages/DomainSets/aafhp/src/domains/interval.jl:52.
ERROR: Method overwriting is not permitted during Module precompilation. Use __precompile__(false) to opt-out of precompilation.
WARNING: Method definition isapprox(IntervalSets.AbstractInterval{T} where T, IntervalSets.AbstractInterval{T} where T) in module IntervalSets at /home/brombo/.julia/packages/IntervalSets/viB6k/src/IntervalSets.jl:144 overwritten in module DomainSets at /home/brombo/.julia/packages/DomainSets/aafhp/src/domains/interval.jl:52.
ERROR: Method overwriting is not permitted during Module precompilation. Use __precompile__(false) to opt-out of precompilation.
I don’t have a clue as to what to due next. Note I am running on ubuntu 22.04.
I installed julia with “sudo snap install --classic julia” and “Pkg.add(“Symbolics”)” to add the symbolics package. I very ignorant with regard to julia. What should I do next.
Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 24 × AMD Ryzen 9 5900X 12-Core Processor
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
Threads: 1 on 24 virtual cores
Status ~/.julia/environments/v1.10/Project.toml
[77e5a97a] AsyPlots v0.2.1
[b964fa9f] LaTeXStrings v1.3.1
[266f59ce] LaTeXTabulars v0.1.3
[d2208f48] LatexPrint v1.1.0
⌅ [23fbe1c1] Latexify v0.15.21
[e9d8d322] Metatheory v2.0.2
[9b87118b] PackageCompiler v2.1.17
⌃ [91a5bcdd] Plots v1.40.0
⌅ [d1185830] SymbolicUtils v0.11.3
⌃ [0c5d862f] Symbolics v0.1.32
Info Packages marked with ⌃ and ⌅ have new versions available. Those with ⌃ may be upgradable, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use status --outdated
WARNING: Method definition isapprox(IntervalSets.AbstractInterval{T} where T, IntervalSets.AbstractInterval{T} where T) in module IntervalSets at /home/brombo/.julia/packages/IntervalSets/viB6k/src/IntervalSets.jl:144 overwritten in module DomainSets at /home/brombo/.julia/packages/DomainSets/aafhp/src/domains/interval.jl:52.
ERROR: Method overwriting is not permitted during Module precompilation. Use __precompile__(false) to opt-out of precompilation.
WARNING: Method definition isapprox(IntervalSets.AbstractInterval{T} where T, IntervalSets.AbstractInterval{T} where T) in module IntervalSets at /home/brombo/.julia/packages/IntervalSets/viB6k/src/IntervalSets.jl:144 overwritten in module DomainSets at /home/brombo/.julia/packages/DomainSets/aafhp/src/domains/interval.jl:52.
ERROR: Method overwriting is not permitted during Module precompilation. Use __precompile__(false) to opt-out of precompilation.
There’s your problem - the current Symbolics release is 5.16, so your version is way out of date. Do ]add Symbolics@5 to find out what’s blocking the update and remove that.
Even better, don’t install all your packages into the default environment but into project-specific environments instead to minimise version conflicts:
To explain why this works, your original environment had many packages causing version incompatibilities. You ended up with an old version of Symbolics.jl.
By creating a new environment with just the packages you want, you reduce the potential conflicts.
Please note that my background python and sympy and am trying to learn to use Symbolics.jl to accomplish sympy type tasks. I am trying to define a struct that has @variables as members. Here is my code -
#!/snap/bin/julia
using Pkg
Pkg.activate(“symbolics”, shared = true)
using Symbolics
using SymbolicUtils
@variables W
struct Pdop
vargs
nargs::Int
end
function prt(x::Pdop)
println(x.vargs,’ ',x.nargs)
end
function
pdx = Pdop(W,2)
prt(pdx)
I don’t know what type vargs should be or how to make this legal. Also is there any way to give a variable an alias when printing like a LaTeX string. For example in sympy I can define -
Thank you. Lots of things are becoming much clearer to me. At the moment what I want to use from Symbolic are the capability for algebraic manipulation, differentiation, and simplification.