# Error with package ApproxFun

**URL:** <https://discourse.julialang.org/t/error-with-package-approxfun/18064>\
**Category:** New to Julia\
**Created:** [November 27, 2018, 1:43pm UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064 "2018-11-27T13:43:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [November 27, 2018, 1:43pm UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/1 "2018-11-27T13:43:01Z")

</div>

How to solve this error of the ApproxFunc Package?

```julia
[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

```

---

<div class="post-metadata">

**Author:** ![jbrea](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbrea/32/3879_2.png) [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Post date:** [November 27, 2018, 5:01pm UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/2 "2018-11-27T17:01:01Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Post date:** [November 27, 2018, 5:24pm UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/3 "2018-11-27T17:24:00Z")

</div>

It’s best to file this as an issue [https://github.com/JuliaApproximation/ApproxFun.jl](https://github.com/JuliaApproximation/ApproxFun.jl)

---

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [November 28, 2018, 5:21am UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/4 "2018-11-28T05:21:26Z")

</div>

> [@dlfivefifty](#):
>
> [GitHub - JuliaApproximation/ApproxFun.jl: Julia package for function approximation](https://github.com/JuliaApproximation/ApproxFun.jl)

installed add [https://github.com/JuliaApproximation/ApproxFun.jl](https://github.com/JuliaApproximation/ApproxFun.jl)

I keep getting problems:

```julia
[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

```

---

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [November 28, 2018, 5:30am UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/5 "2018-11-28T05:30:05Z")

</div>

BlockBandedMatrices was installed as a dependency of some other package. I did not install it directly.  
execute the following

```julia
rm BlockBandedMatrices
add BlockBandedMatrices

```

and the problem persists

Is there any way to see package dependency tree in julia 1.0.2?

---

<div class="post-metadata">

**Author:** ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Post date:** [November 28, 2018, 7:27am UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/6 "2018-11-28T07:27:53Z")

</div>

What’s your `Pkg.status()`

---

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [November 28, 2018, 7:41am UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/7 "2018-11-28T07:41:25Z")

</div>

After installation

` add https://github.com/JuliaApproximation/ApproxFun.jl`

perform the following steps:

```julia
(v1.0) pkg> rm ApproxFun
  Updating `C:\Users\hermesr\.julia\environments\v1.0\Project.toml`
  [28f2ccd6] - ApproxFun v0.10.2+ #master (https://github.com/JuliaApproximation
/ApproxFun.jl)
  Updating `C:\Users\hermesr\.julia\environments\v1.0\Manifest.toml`
 [no changes]

(v1.0) pkg> dev https://github.com/JuliaApproximation/ApproxFun.jl.git
   Cloning git-repo `https://github.com/JuliaApproximation/ApproxFun.jl.git`
  Updating git-repo `https://github.com/JuliaApproximation/ApproxFun.jl.git`
 Resolving package versions...
  Updating `C:\Users\hermesr\.julia\environments\v1.0\Project.toml`
  [28f2ccd6] + ApproxFun v0.10.2+ [`C:\Users\hermesr\.julia\dev\ApproxFun`]
  Updating `C:\Users\hermesr\.julia\environments\v1.0\Manifest.toml`
  [28f2ccd6] ~ ApproxFun v0.10.2+ #master (https://github.com/JuliaApproximation
/ApproxFun.jl) ? v0.10.2+ [`C:\Users\hermesr\.julia\dev\ApproxFun`]

(v1.0) pkg> st
    Status `C:\Users\hermesr\.julia\environments\v1.0\Project.toml`
  [28f2ccd6] ApproxFun v0.10.2+ [`C:\Users\hermesr\.julia\dev\ApproxFun`]
  [d9fa014c] ApproxFunExamples v0.1.0 #master (https://github.com/JuliaApproxima
tion/ApproxFunExamples.git)
  [c52e3926] Atom v0.7.10
  [717857b8] DSP v0.5.1
  [a93c6f00] DataFrames v0.14.1
  [225cb15b] DiffEqTutorials v0.0.0 #master (https://github.com/JuliaDiffEq/Diff
EqTutorials.jl.git)
  [0c46a032] DifferentialEquations v5.3.1
  [7073ff75] IJulia v1.14.1
  [e5e0dc1b] Juno v0.5.3
  [1902f260] Knet v1.1.1
  [ff71e718] MixedModels v1.1.1
  [5fb14364] OhMyREPL v0.4.0
  [1dea7af3] OrdinaryDiffEq v4.17.2
  [91a5bcdd] Plots v0.21.0
  [438e738f] PyCall v1.18.5
  [d330b81b] PyPlot v2.6.3
  [6f49c342] RCall v0.13.0
  [df47a6cb] RData v0.5.0
  [ce6b1742] RDatasets v0.6.1
  [276daf66] SpecialFunctions v0.7.2
  [44dac47c] VMLS v0.2.0 #master (https://github.com/VMLS-book/VMLS.jl)
  [bd07be1c] Winston v0.14.1
  [37e2e46d] LinearAlgebra
  [9a3f8284] Random
  [2f01184e] SparseArrays

(v1.0) pkg>

```

And I still have problems:

```julia
[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

```julia
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

```

---

<div class="post-metadata">

**Author:** ![jbrea](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbrea/32/3879_2.png) [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Post date:** [November 28, 2018, 8:18am UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/8 "2018-11-28T08:18:51Z")

</div>

Are you on a 32-bit machine? If yes, I would recommend to do

```julia
pgk> add BlockBandedMatrices#master

```

because of [this](https://github.com/JuliaMatrices/BlockBandedMatrices.jl/commit/2f0f83bdd0bd6f8a33974b0bde50f8a2940e225b). Then you can retry compiling `ApproxFun`.

---

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [November 28, 2018, 8:30am UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/9 "2018-11-28T08:30:36Z")

</div>

> [@jbrea](#):
>
> add BlockBandedMatrices#master

Solved the problem:

 ![Introduccion%20ApproxFun_1](https://global.discourse-cdn.com/julialang/original/3X/3/e/3ec5417a71e9826df619c583da6735c1f921eddb.jpeg)

@Gracias

---

<div class="post-metadata">

**Author:** ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Post date:** [November 28, 2018, 9:37am UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/10 "2018-11-28T09:37:33Z")

</div>

It’s recommended to stick to tagged versions of the packages as the master branch is often experimentalz

---

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [November 28, 2018, 10:27am UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/11 "2018-11-28T10:27:41Z")

</div>

Please tell me how to do it

---

<div class="post-metadata">

**Author:** ![jbrea](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbrea/32/3879_2.png) [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Post date:** [November 28, 2018, 10:29am UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/12 "2018-11-28T10:29:29Z")

</div>

Sure. But if he is on a 32-bit machine and [this fix](https://github.com/JuliaMatrices/BlockBandedMatrices.jl/commit/2f0f83bdd0bd6f8a33974b0bde50f8a2940e225b) is not yet on a newly tagged version?

---

<div class="post-metadata">

**Author:** ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Post date:** [November 28, 2018, 10:35am UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/13 "2018-11-28T10:35:49Z")

</div>

The issue is that he’s running ApproxFun.jl on master. The tagged version is tested and passes on 32 bit machines.

---

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [November 28, 2018, 10:39am UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/14 "2018-11-28T10:39:27Z")

</div>

Yes I work in 32-bit Operating System!!

---

<div class="post-metadata">

**Author:** ![jbrea](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbrea/32/3879_2.png) [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Post date:** [November 28, 2018, 10:51am UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/15 "2018-11-28T10:51:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Post date:** [November 28, 2018, 7:15pm UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/16 "2018-11-28T19:15:38Z")

</div>

I’ll tag new versions now

---

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [December 5, 2018, 4:13pm UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/17 "2018-12-05T16:13:33Z")

</div>

> [@HerAdri](#):
>
> ![Introduccion%20ApproxFun_1](https://global.discourse-cdn.com/julialang/original/3X/3/e/3ec5417a71e9826df619c583da6735c1f921eddb.jpeg)
> 
> Introduccion ApproxFun\_1.jpg831x375 62 KB

Until recently everything worked well, now I have the following error and I do not know what to do, EVERYTHING WAS GOOD!

```julia
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.

```julia
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

```

---

<div class="post-metadata">

**Author:** ![Karajan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/karajan/32/8545_2.png) [@Karajan](https://discourse.julialang.org/u/Karajan)\
**Post date:** [December 5, 2018, 4:18pm UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/18 "2018-12-05T16:18:34Z")

</div>

> [@HerAdri](#):
>
> `LoadError: invalid redefinition of constant f`

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.

---

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [December 5, 2018, 4:24pm UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/19 "2018-12-05T16:24:15Z")

</div>

Perfect!!! Work  
Is there an instruction to clean the WorkSpace?

---

<div class="post-metadata">

**Author:** ![Karajan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/karajan/32/8545_2.png) [@Karajan](https://discourse.julialang.org/u/Karajan)\
**Post date:** [December 5, 2018, 4:28pm UTC](https://discourse.julialang.org/t/error-with-package-approxfun/18064/20 "2018-12-05T16:28:58Z")

</div>

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.

[Next page](https://discourse.julialang.org/t/error-with-package-approxfun/18064.md?page=2)
