How to solve this error of the ApproxFunc Package?
[ Info: Precompiling ApproxFun [28f2ccd6-bb30-5033-b560-165f7b14dc2f]
ERROR: LoadError: LoadError: TypeError: in BlockIndexRange, in R, expected R<:Tuple{Vararg{AbstractU
nitRange{Int32},N}}, got Type{Tuple{UnitRange{Int64}}}
Stacktrace:
[1] top-level scope at none:0
[2] include at .\sysimg.jl:29 [inlined]
[3] include(::String) at C:\Users\hermesr\.julia\packages\BlockBandedMatrices\fQqi6\src\BlockBanded
Matrices.jl:2
[4] top-level scope at none:0
[5] include at .\boot.jl:317 [inlined]
[6] include_relative(::Module, ::String) at .\loading.jl:1044
[7] include(::Module, ::String) at .\sysimg.jl:29
[8] top-level scope at none:2
[9] eval at .\boot.jl:319 [inlined]
[10] eval(::Expr) at .\client.jl:393
[11] top-level scope at .\none:3
in expression starting at C:\Users\hermesr\.julia\packages\BlockBandedMatrices\fQqi6\src\linalg.jl:4
in expression starting at C:\Users\hermesr\.julia\packages\BlockBandedMatrices\fQqi6\src\BlockBanded
Matrices.jl:54
ERROR: LoadError: Failed to precompile BlockBandedMatrices [ffab5731-97b5-5995-9138-79e8c1846df0] to
C:\Users\hermesr\.julia\compiled\v1.0\BlockBandedMatrices\0zTvf.ji.
Stacktrace:
[1] error(::String) at .\error.jl:33
[2] macro expansion at .\logging.jl:311 [inlined]
[3] compilecache(::Base.PkgId, ::String) at .\loading.jl:1190
[4] macro expansion at .\logging.jl:309 [inlined]
[5] _require(::Base.PkgId) at .\loading.jl:947
[6] require(::Base.PkgId) at .\loading.jl:858
[7] macro expansion at .\logging.jl:309 [inlined]
[8] require(::Module, ::Symbol) at .\loading.jl:840
[9] include at .\boot.jl:317 [inlined]
[10] include_relative(::Module, ::String) at .\loading.jl:1044
[11] include(::Module, ::String) at .\sysimg.jl:29
[12] top-level scope at none:2
[13] eval at .\boot.jl:319 [inlined]
[14] eval(::Expr) at .\client.jl:393
[15] top-level scope at .\none:3
in expression starting at C:\Users\hermesr\.julia\packages\ApproxFun\DkMmw\src\ApproxFun.jl:4
ERROR: LoadError: Failed to precompile ApproxFun [28f2ccd6-bb30-5033-b560-165f7b14dc2f] to C:\Users\
hermesr\.julia\compiled\v1.0\ApproxFun\jGqLz.ji.
Stacktrace:
[1] macro expansion at .\logging.jl:311 [inlined]
[2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1190
[3] macro expansion at .\logging.jl:309 [inlined]
[4] _require(::Base.PkgId) at .\loading.jl:947
[5] require(::Base.PkgId) at .\loading.jl:858
[6] macro expansion at .\logging.jl:309 [inlined]
[7] require(::Module, ::Symbol) at .\loading.jl:840
in expression starting at C:\Users\hermesr\Documents\Julia software\Julia Scripts\Introduccion Appro
xFun 1.jl:1
I have no problem adding ApproxFun with julia 1.0.2.
Maybe you have a version issue? It looks like the error is related to BlockBandedMatrices.
Which version of ApproxFun and BlockBandedMatrices do you want to use?
[ Info: Precompiling ApproxFun [28f2ccd6-bb30-5033-b560-165f7b14dc2f]
ERROR: LoadError: LoadError: TypeError: in BlockIndexRange, in R, expected R<:Tuple{Vararg{AbstractU
nitRange{Int32},N}}, got Type{Tuple{UnitRange{Int64}}}
Stacktrace:
[1] top-level scope at none:0
[2] include at .\sysimg.jl:29 [inlined]
[3] include(::String) at C:\Users\hermesr\.julia\packages\BlockBandedMatrices\fQqi6\src\BlockBanded
Matrices.jl:2
[4] top-level scope at none:0
[5] include at .\boot.jl:317 [inlined]
[6] include_relative(::Module, ::String) at .\loading.jl:1044
[7] include(::Module, ::String) at .\sysimg.jl:29
[8] top-level scope at none:2
[9] eval at .\boot.jl:319 [inlined]
[10] eval(::Expr) at .\client.jl:393
[11] top-level scope at .\none:3
in expression starting at C:\Users\hermesr\.julia\packages\BlockBandedMatrices\fQqi6\src\linalg.jl:4
in expression starting at C:\Users\hermesr\.julia\packages\BlockBandedMatrices\fQqi6\src\BlockBanded
Matrices.jl:54
ERROR: LoadError: Failed to precompile BlockBandedMatrices [ffab5731-97b5-5995-9138-79e8c1846df0] to
C:\Users\hermesr\.julia\compiled\v1.0\BlockBandedMatrices\0zTvf.ji.
Stacktrace:
[1] error(::String) at .\error.jl:33
[2] macro expansion at .\logging.jl:311 [inlined]
[3] compilecache(::Base.PkgId, ::String) at .\loading.jl:1190
[4] macro expansion at .\logging.jl:309 [inlined]
[5] _require(::Base.PkgId) at .\loading.jl:947
[6] require(::Base.PkgId) at .\loading.jl:858
[7] macro expansion at .\logging.jl:309 [inlined]
[8] require(::Module, ::Symbol) at .\loading.jl:840
[9] include at .\boot.jl:317 [inlined]
[10] include_relative(::Module, ::String) at .\loading.jl:1044
[11] include(::Module, ::String) at .\sysimg.jl:29
[12] top-level scope at none:2
[13] eval at .\boot.jl:319 [inlined]
[14] eval(::Expr) at .\client.jl:393
[15] top-level scope at .\none:3
in expression starting at C:\Users\hermesr\.julia\packages\ApproxFun\DkMmw\src\ApproxFun.jl:4
ERROR: LoadError: Failed to precompile ApproxFun [28f2ccd6-bb30-5033-b560-165f7b14dc2f] to C:\Users\
hermesr\.julia\compiled\v1.0\ApproxFun\jGqLz.ji.
Stacktrace:
[1] macro expansion at .\logging.jl:311 [inlined]
[2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1190
[3] macro expansion at .\logging.jl:309 [inlined]
[4] _require(::Base.PkgId) at .\loading.jl:947
[5] require(::Base.PkgId) at .\loading.jl:858
[6] macro expansion at .\logging.jl:309 [inlined]
[7] require(::Module, ::Symbol) at .\loading.jl:840
in expression starting at C:\Users\hermesr\Documents\Julia software\Julia Scripts\Introduccion Appro
xFun 1.jl:1
[ Info: Precompiling ApproxFun [28f2ccd6-bb30-5033-b560-165f7b14dc2f]
ERROR: LoadError: LoadError: TypeError: in BlockIndexRange, in R, expected R<:Tuple{Vararg{AbstractU
nitRange{Int32},N}}, got Type{Tuple{UnitRange{Int64}}}
Stacktrace:
[1] top-level scope at none:0
[2] include at .\sysimg.jl:29 [inlined]
[3] include(::String) at C:\Users\hermesr\.julia\packages\BlockBandedMatrices\fQqi6\src\BlockBanded
Matrices.jl:2
[4] top-level scope at none:0
[5] include at .\boot.jl:317 [inlined]
[6] include_relative(::Module, ::String) at .\loading.jl:1044
[7] include(::Module, ::String) at .\sysimg.jl:29
[8] top-level scope at none:2
[9] eval at .\boot.jl:319 [inlined]
[10] eval(::Expr) at .\client.jl:393
[11] top-level scope at .\none:3
in expression starting at C:\Users\hermesr\.julia\packages\BlockBandedMatrices\fQqi6\src\linalg.jl:4
in expression starting at C:\Users\hermesr\.julia\packages\BlockBandedMatrices\fQqi6\src\BlockBanded
Matrices.jl:54
ERROR: LoadError: Failed to precompile BlockBandedMatrices [ffab5731-97b5-5995-9138-79e8c1846df0] to
C:\Users\hermesr\.julia\compiled\v1.0\BlockBandedMatrices\0zTvf.ji.
Stacktrace:
[1] error(::String) at .\error.jl:33
[2] macro expansion at .\logging.jl:311 [inlined]
[3] compilecache(::Base.PkgId, ::String) at .\loading.jl:1190
[4] macro expansion at .\logging.jl:309 [inlined]
[5] _require(::Base.PkgId) at .\loading.jl:947
[6] require(::Base.PkgId) at .\loading.jl:858
[7] macro expansion at .\logging.jl:309 [inlined]
[8] require(::Module, ::Symbol) at .\loading.jl:840
[9] include at .\boot.jl:317 [inlined]
[10] include_relative(::Module, ::String) at .\loading.jl:1044
[11] include(::Module, ::String) at .\sysimg.jl:29
[12] top-level scope at none:2
[13] eval at .\boot.jl:319 [inlined]
[14] eval(::Expr) at .\client.jl:393
[15] top-level scope at .\none:3
in expression starting at C:\Users\hermesr\.julia\dev\ApproxFun\src\ApproxFun.jl:4
ERROR: LoadError: Failed to precompile ApproxFun [28f2ccd6-bb30-5033-b560-165f7b14dc2f] to C:\Users\
hermesr\.julia\compiled\v1.0\ApproxFun\jGqLz.ji.
Stacktrace:
[1] macro expansion at .\logging.jl:311 [inlined]
[2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1190
[3] macro expansion at .\logging.jl:309 [inlined]
[4] _require(::Base.PkgId) at .\loading.jl:947
[5] require(::Base.PkgId) at .\loading.jl:858
[6] macro expansion at .\logging.jl:309 [inlined]
[7] require(::Module, ::Symbol) at .\loading.jl:840
in expression starting at C:\Users\hermesr\Documents\Julia software\Julia Scripts\Introduccion Appro
xFun 1.jl:1
julia>
Alert in Atom
Error evaluating Introduccion ApproxFun 1.jl
LoadError: Failed to precompile ApproxFun [28f2ccd6-bb30-5033-b560-165f7b14dc2f] to C:\Users\hermesr\.julia\compiled\v1.0\ApproxFun\jGqLz.ji.
in expression starting at C:\Users\hermesr\Documents\Julia software\Julia Scripts\Introduccion ApproxFun 1.jl:1
error(::String) at error.jl:33
macro expansion at logging.jl:311 [inlined]
compilecache(::Base.PkgId, ::String) at loading.jl:1190
macro expansion at logging.jl:309 [inlined]
_require(::Base.PkgId) at loading.jl:947
require(::Base.PkgId) at loading.jl:858
macro expansion at logging.jl:309 [inlined]
require(::Module, ::Symbol) at loading.jl:840
Ah, you’re right @dlfivefifty, dev https://github.com/JuliaApproximation/ApproxFun.jl.git pulls the master branch.
edit: I think ApproxFun#master is currently identical to the last tagged version.
I think the problem really is that BlockBandedMatrices#0.3.0 doesn’t work on 32-bit machines.
Until recently everything worked well, now I have the following error and I do not know what to do, EVERYTHING WAS GOOD!
using LinearAlgebra, SpecialFunctions, Plots, ApproxFun
x = Fun(identity,0..10)
f = sin(x^2)
g = cos(x)
h = f + g^2
r = roots(h)
rp = roots(h')
using Plots
plot(h)
scatter!(r,h.(r))
scatter!(rp,h.(rp))
Error evaluating Introduccion ApproxFun 1.jl
LoadError: invalid redefinition of constant f
in expression starting at C:\Users\hermesr\Documents\Julia software\Julia Scripts\Introduccion ApproxFun 1.jl:3
top-level scope at none:0
This same error is repeated in other examples.
Error evaluating Introduccion ApproxFun 4.jl
LoadError: invalid redefinition of constant f
in expression starting at C:\Users\hermesr\Documents\Julia software\Julia Scripts\UsoApproxFun\Introduccion ApproxFun 4.jl:2
top-level scope at none:0
This sounds like you have used some constant called f so redefining it to f = sin(x^2) fails. I suggest restarting Julia (if you have had a variable f) or renaming your function to something else.
None that I’m aware of, except restarting Julia. But maybe someone else knows a way.
A good way around this would be to give the variables and functions more descriptive names so it is harder that these “accidental collision” happen. For me this also had the benefit that I am much more likely to understand my own code after not looking at it for two weeks.