Using StatPlots failing, today, after it worked, yesterday

In an attempt to explore @benchmark - results, I tried using StatPlots, but ran into the following Error

(the weird thing is, that I had StatPlots up and running, yesterday, already, but it fails, today).

julia> using StatPlots
 │ Package StatPlots not found, but a package named StatPlots is available from a registry. 
 │ Install package?
 │   (@v1.8) pkg> add StatPlots
 └ (y/n/o) [y]: y
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package StatPlots [60ddc479]:
 StatPlots [60ddc479] log:
 ├─possible versions are: 0.8.0-0.9.2 or uninstalled
 ├─restricted to versions * by an explicit requirement, leaving only versions 0.8.0-0.9.2
 └─restricted by julia compatibility requirements to versions: uninstalled — no versions left

…I don’t know, how the whole versioning works, as of yet - am I the one, restricting the requirements for versions in some setting?

julia-version:

julia> versioninfo()
Julia Version 1.8.2
Commit 36034abf26 (2022-09-29 15:21 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, znver1)
  Threads: 8 on 8 virtual cores
Environment:
  JULIA_EDITOR = code

Also not sure, the Stacktrace is of any use…

Stacktrace:
  [1] propagate_constraints!(graph::Pkg.Resolve.Graph, sources::Set{Int64}; log_events::Bool)
    @ Pkg.Resolve C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\Pkg\src\Resolve\graphtype.jl:1072
  [2] propagate_constraints! (repeats 2 times)
    @ C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\Pkg\src\Resolve\graphtype.jl:1008 [inlined]
  [3] simplify_graph!(graph::Pkg.Resolve.Graph, sources::Set{Int64}; clean_graph::Bool)
    @ Pkg.Resolve C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\Pkg\src\Resolve\graphtype.jl:1533
  [4] simplify_graph! (repeats 2 times)
    @ C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\Pkg\src\Resolve\graphtype.jl:1532 [inlined]
  [5] resolve_versions!(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, julia_version::VersionNumber)
    @ Pkg.Operations C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:352
  [6] targeted_resolve(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, preserve::Pkg.Types.PreserveLevel, julia_version::VersionNumber)
    @ Pkg.Operations C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1254
  [7] tiered_resolve(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, julia_version::VersionNumber)
    @ Pkg.Operations C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1239
  [8] _resolve(io::Base.TTY, env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, preserve::Pkg.Types.PreserveLevel, julia_version::VersionNumber)
    @ Pkg.Operations C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1260
  [9] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Set{Base.UUID}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform)
    @ Pkg.Operations C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1276
 [10] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
    @ Pkg.API C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\Pkg\src\API.jl:275
 [11] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\Pkg\src\API.jl:156
 [12] add(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\Pkg\src\API.jl:145
 [13] #add#27
    @ C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\Pkg\src\API.jl:144 [inlined]
 [14] add
    @ C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\Pkg\src\API.jl:144 [inlined]
 [15] try_prompt_pkg_add(pkgs::Vector{Symbol})
    @ Pkg.REPLMode C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\Pkg\src\REPLMode\REPLMode.jl:717
 [16] #invokelatest#2
    @ .\essentials.jl:729 [inlined]
 [17] invokelatest
    @ .\essentials.jl:726 [inlined]
 [18] check_for_missing_packages_and_run_hooks(ast::Any)
    @ REPL C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\REPL\src\REPL.jl:176
 [19] eval_user_input(ast::Any, backend::REPL.REPLBackend)
    @ REPL C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\REPL\src\REPL.jl:146
 [20] repl_backend_loop(backend::REPL.REPLBackend)
    @ REPL C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\REPL\src\REPL.jl:247
 [21] start_repl_backend(backend::REPL.REPLBackend, consumer::Any)
    @ REPL C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\REPL\src\REPL.jl:232
 [22] run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool)
    @ REPL C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\REPL\src\REPL.jl:369
 [23] run_repl(repl::REPL.AbstractREPL, consumer::Any)
    @ REPL C:\Users\rober\.julia\juliaup\julia-1.8.2+0.x64\share\julia\stdlib\v1.8\REPL\src\REPL.jl:355
 [24] (::Base.var"#967#969"{Bool, Bool, Bool})(REPL::Module)
    @ Base .\client.jl:419
 [25] #invokelatest#2
    @ .\essentials.jl:729 [inlined]
 [26] invokelatest
    @ .\essentials.jl:726 [inlined]
 [27] run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool)
    @ Base .\client.jl:404
 [28] exec_options(opts::Base.JLOptions)
    @ Base .\client.jl:318
 [29] _start()
    @ Base .\client.jl:522

Note: In an attempt to fix stuff, I already ran update, which easily took some 5…10 Mins or so, but did not fix the issue…

(@v1.8) pkg>  update
    Updating registry at `C:\Users\rober\.julia\registries\General.toml`
   Installed OffsetArrays ─── v1.12.8
   Installed SentinelArrays ─ v1.3.16
   Installed OpenSSL_jll ──── v1.1.18+0
   Installed PlotThemes ───── v3.1.0
   Installed Tables ───────── v1.10.0
   Installed HTTP ─────────── v1.4.1
   Installed Distributions ── v0.25.76
   Installed GR ───────────── v0.69.5
  Downloaded artifact: OpenSSL
    Updating `C:\Users\rober\.julia\environments\v1.8\Project.toml`
  [31c24e10] ↑ Distributions v0.25.75 ⇒ v0.25.76
    Updating `C:\Users\rober\.julia\environments\v1.8\Manifest.toml`
  [31c24e10] ↑ Distributions v0.25.75 ⇒ v0.25.76
  [28b8d3ca] ↑ GR v0.69.4 ⇒ v0.69.5
  [cd3eb016] ↑ HTTP v1.4.0 ⇒ v1.4.1
  [6fe1bfb0] ↑ OffsetArrays v1.12.7 ⇒ v1.12.8
  [ccf2f8ad] ↑ PlotThemes v3.0.0 ⇒ v3.1.0
  [91c51154] ↑ SentinelArrays v1.3.15 ⇒ v1.3.16
  [bd369af6] ↑ Tables v1.9.0 ⇒ v1.10.0
  [458c3c95] ↑ OpenSSL_jll v1.1.17+0 ⇒ v1.1.18+0
Precompiling project...
  46 dependencies successfully precompiled in 487 seconds. 210 already precompiled.

StatPlots is the old name of StatsPlots.jl (Stats instead of Stat), and isn’t compatible with modern versions of Julia.
You most likely want to install StatsPlots instead.

2 Likes

Also, you really should create a directory for you project and then Pkg.activate(...) in that project. The dependencies will be tracked for that project and it’s a lot easier to keep dependencies in check when you have only 5-6 packages for a given project rather than say 30 all dumped into the global environment.

The global environment is best used only for core stuff you want in pretty much every context, like Revise, or OhMyREPL or Infiltrator or such tools.

1 Like

StatPlots is the old name of StatsPlots.jl (Stats instead of Stat), and isn’t compatible with modern versions of Julia.
You most likely want to install StatsPlots instead.

Thx a bunch! So glad I asked - I could’ve likely spent 2d, before giving up, without resolving this, on my own. :sweat_smile:

Also, you really should create a directory for you project and then Pkg.activate(...) in that project. The dependencies will be tracked for that project and it’s a lot easier to keep dependencies in check when you have only 5-6 packages for a given project rather than say 30 all dumped into the global environment.

The global environment is best used only for core stuff you want in pretty much every context, like Revise, or OhMyREPL or Infiltrator or such tools.

Thx, I realize, I need to dig into the whole deal of organizing my project with files, directories and depenedencies (I only really have one “project”, though), but exploring all kinds of functionalities in julia is keeping me too busy, currently.

As a newcomer, there seems to be an abundance of options, revolving around the keywords of install, using, add, activate, update, version-requirements and possibly more, wrt. to packages… :woozy_face:

As of yet, my setup is so random and chaotic, that it seems to be more efficient to keep working like this, for a while, until I run into problems and then “just” save my code, reset everything and start a cleaner setup from scratch, with some lessons learned (hopefully, meanwhile).
Who knows - until then, I might have switched my ide, figured that installing julia from the microsoft-store was a bad idea and maybe I’m going to choose the LTS-release over the latest stable one…

…simply too much information, and uncertainty, atm, to be setting up anything long-term. :sweat_smile:

1 Like

I know how you feel, I was the same way for the first several months of using Julia. Eventually I had hundreds of packages in my global environment and they were all frozen in place because upgrading any one of them was incompatible with other ones etc…

Then I deleted my global environment entirely, and started from scratch. I never install basically ANYTHING in the global environment anymore… Here is what’s in my global environment:

dlakelan@tintin:~$ cat  .julia/environments/v1.8/Project.toml 
[deps]
AbbreviatedStackTraces = "ac637c84-cc71-43bf-9c33-c1b4316be3d4"
PkgTemplates = "14b8a8f1-9102-5b29-a752-f990bacb7fe1"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"

From then on things worked smoothly, with dependencies tracked on a per-project basis.

1 Like

From then on things worked smoothly, with dependencies tracked on a per-project basis.

…this is the important re-assurance, I need, atm.
I.e. just knowing, that this stuff can be handled cleanly and reliably, in jullia.
I’ll be getting there, in time. :+1:

1 Like

I wonder if it’s worth yanking all versions of StatPlots?