# Cannot load Plot package in Julia

**URL:** <https://discourse.julialang.org/t/cannot-load-plot-package-in-julia/98244>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [May 3, 2023, 12:17pm UTC](https://discourse.julialang.org/t/cannot-load-plot-package-in-julia/98244 "2023-05-03T12:17:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yining\_Wang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yining_wang/32/49451_2.png) [@Yining\_Wang](https://discourse.julialang.org/u/Yining_Wang)\
**Post date:** [May 3, 2023, 12:17pm UTC](https://discourse.julialang.org/t/cannot-load-plot-package-in-julia/98244/1 "2023-05-03T12:17:38Z")

</div>

I am using Julia on a Mac laptop. Everything worked fine until yesterday when I want to do some plots I can no longer import the **Plots** package. When I try to do **Using Plots** , I receive the following error message:

[Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] ERROR: LoadError: MethodError: no method matching floatrange(::Type{Float64}, ::Int64, ::Int64, ::Float64, ::Int64) Closest candidates are: floatrange(::Type{T}, ::Integer, ::Integer, ::Integer, ::Integer) where T at twiceprecision.jl:381 floatrange(::AbstractFloat, ::AbstractFloat, ::Real, ::AbstractFloat) at twiceprecision.jl:395 Stacktrace: [1] floatrange(a::Float64, st::Float64, len::Float64, divisor::Float64) @ Base ./twiceprecision.jl:403 …

**What I have tried** : I have tried the following methods but unfortunately none of them works:

1. Tried to do Pkg.update(), Pkg.resolve(), Pkg.gc()
2. Tried to first do Pkg.rm(“Plots”) and then Pkg.add(“Plots”). Both commands executed without errors but when I try to import the package again the same error message occurs.
3. Tried [PkgCleanup · Julia Packages](https://juliapackages.com/p/pkgcleanup) but it doesn’t work.
4. Tried all methods mentioned in these two links: [MethodError: no method matching floatrange when running histogram. 1.7.0 Win 11 21H2 AMD 5900Hx - #6 by enzomar](https://discourse.julialang.org/t/methoderror-no-method-matching-floatrange-when-running-histogram-1-7-0-win-11-21h2-amd-5900hx/72679/6) [MethodError: no method matching floatrange when running histogram. 1.7.0 Win 11 21H2 AMD 5900Hx - #6 by enzomar](https://discourse.julialang.org/t/methoderror-no-method-matching-floatrange-when-running-histogram-1-7-0-win-11-21h2-amd-5900hx/72679/6) but unfortunately nothing worked.

The links above did mention something about deleting “old manefest/project files” but unfortunately, as someone who is new to Julia, I have no idea what this means, or how to do that. Any suggestions are greatly appreciated.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [May 3, 2023, 12:20pm UTC](https://discourse.julialang.org/t/cannot-load-plot-package-in-julia/98244/2 "2023-05-03T12:20:26Z")

</div>

What Version of plots are you on? Can you show the output of `] st` in the environment in which you’re seeing this error?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [May 3, 2023, 12:31pm UTC](https://discourse.julialang.org/t/cannot-load-plot-package-in-julia/98244/3 "2023-05-03T12:31:13Z")

</div>

This is the PR that fixed this [fix call of floatrange on 1.7+ by KristofferC · Pull Request #703 · JuliaStats/StatsBase.jl · GitHub](https://github.com/JuliaStats/StatsBase.jl/pull/703). So you must be on a StatsBase version before that.

---

<div class="post-metadata">

**Author:** ![Yining\_Wang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yining_wang/32/49451_2.png) [@Yining\_Wang](https://discourse.julialang.org/u/Yining_Wang)\
**Post date:** [May 3, 2023, 2:39pm UTC](https://discourse.julialang.org/t/cannot-load-plot-package-in-julia/98244/4 "2023-05-03T14:39:49Z")

</div>

Thank you nilshg. It’s version 1.8 as the output of “]”

---

<div class="post-metadata">

**Author:** ![Yining\_Wang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yining_wang/32/49451_2.png) [@Yining\_Wang](https://discourse.julialang.org/u/Yining_Wang)\
**Post date:** [May 3, 2023, 2:42pm UTC](https://discourse.julialang.org/t/cannot-load-plot-package-in-julia/98244/5 "2023-05-03T14:42:14Z")

</div>

Thank you Kristoffer. I executed a command “Pkg.Update(“StatsBase”)” and it executed without errors. Here are the messages:

```
Updating registry at `~/.julia/registries/General.toml`

```

No Changes to `~/.julia/environments/v1.8/Project.toml`  
Updating `~/.julia/environments/v1.8/Manifest.toml`  
⌅ [4fba245c] + ArrayInterface v2.14.17  
[01453d9d] ↑ DiffEqDiffTools v0.14.0 ⇒ v1.7.0  
Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`  
Precompiling project…  
5 dependencies successfully precompiled in 11 seconds. 222 already precompiled. 1 skipped during auto due to previous errors.

After this, I tried “Using Plots” but am still receiving the same error message.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [May 3, 2023, 3:51pm UTC](https://discourse.julialang.org/t/cannot-load-plot-package-in-julia/98244/6 "2023-05-03T15:51:43Z")

</div>

No, that’s not the output of `]` - `]` just drops you into the Pkg REPL mode, and the `@v1.8` just means you are in your default environment. You then have to type `st` and press enter to get the versions of all installed packages.

---

<div class="post-metadata">

**Author:** ![Yining\_Wang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yining_wang/32/49451_2.png) [@Yining\_Wang](https://discourse.julialang.org/u/Yining_Wang)\
**Post date:** [May 3, 2023, 3:56pm UTC](https://discourse.julialang.org/t/cannot-load-plot-package-in-julia/98244/7 "2023-05-03T15:56:29Z")

</div>

Sorry for the confusion. The versions of packages are below, by running the “st” command at ] environment:

Status `~/.julia/environments/v1.8/Project.toml`

[a93c6f00] DataFrames v1.5.0

⌅ [31c24e10] Distributions v0.23.8

⌃ [38e38edf] GLM v1.4.2

[8d5ece8b] GLMNet v0.7.1

⌃ [033835bb] JLD2 v0.4.3

[857edff2] KernelEstimator v0.3.3

⌃ [b4fcebef] Lasso v0.5.2

⌃ [355abbd5] POMDPModels v0.4.9

[a575d7f4] POMDPSolve v0.2.3

[a93abf59] POMDPs v0.9.5

[f3e62ec7] PkgCleanup v0.1.0 `https://github.com/giordano/PkgCleanup.jl#main`

⌃ [91a5bcdd] Plots v1.35.2

⌃ [3aa3ecc9] QMDP v0.1.6

⌅ [2913bbd2] StatsBase v0.32.2

Info Packages marked with ⌃ and ⌅ have new versions available, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated`

It does seem StatsBase is outdated in this list. However this is after I carried out Pkg.update(StatsBase). Any suggestion on how to update it to the latest 1.7.0 version?

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [May 3, 2023, 3:59pm UTC](https://discourse.julialang.org/t/cannot-load-plot-package-in-julia/98244/8 "2023-05-03T15:59:23Z")

</div>

Your plots is pretty outdated - the current version is 1.38.11. Do `add Plots@1.38` in the Pkg REPL to see what’s holding it back.

On a related note, it is not recommended to install all packages in the default environment. You should keep only development dependencies like IJulia, Revise etc. in the default environment and work in project specific environments with only those packages needed for a specific piece of work to minimise these kinds of version conflicts.

---

<div class="post-metadata">

**Author:** ![Yining\_Wang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yining_wang/32/49451_2.png) [@Yining\_Wang](https://discourse.julialang.org/u/Yining_Wang)\
**Post date:** [May 3, 2023, 4:04pm UTC](https://discourse.julialang.org/t/cannot-load-plot-package-in-julia/98244/9 "2023-05-03T16:04:19Z")

</div>

Thank you! This now works perfectly for me.

And also appreciate your suggestions on default/specific environments. Have been transiting from Matlab to Julia for less than a month so still a lot to learn 🙂
