2

I am trying to install the PlotlyJS package, but I get the following error:

julia> Pkg.add("PlotlyJS")
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Mux [a975b10e]:
 Mux [a975b10e] log:
 ├─possible versions are: 0.4.0-1.0.1 or uninstalled
 ├─restricted by compatibility requirements with HTTP [cd3eb016] to versions: 1.0.0-1.0.1 or uninstalled
 │ └─HTTP [cd3eb016] log:
 │   ├─possible versions are: 0.6.10-1.6.2 or uninstalled
 │   ├─restricted to versions 1 by Genie [c43c736e], leaving only versions 1.0.0-1.6.2
 │   │ └─Genie [c43c736e] log:
 │   │   ├─possible versions are: 5.13.0 or uninstalled
 │   │   └─Genie [c43c736e] is fixed to version 5.13.0
 │   └─restricted by compatibility requirements with LoggingExtras [e6f89c97] to versions: [0.6.10-0.9.17, 1.5.4-1.6.2] or uninstalled, leaving only versions: 1.5.4-1.6.2
 │     └─LoggingExtras [e6f89c97] log:
 │       ├─possible versions are: 0.1.0-1.0.0 or uninstalled
 │       └─restricted to versions 1 by Genie [c43c736e], leaving only versions 1.0.0
 │         └─Genie [c43c736e] log: see above
 └─restricted by compatibility requirements with Blink [ad839575] to versions: 0.7.0-0.7.6 — no versions left
   └─Blink [ad839575] log:
     ├─possible versions are: 0.8.0-0.12.5 or uninstalled
     └─restricted by compatibility requirements with Reexport [189a3867] to versions: 0.12.5 or uninstalled, leaving only versions: 0.12.5
       └─Reexport [189a3867] log:
         ├─possible versions are: 0.2.0-1.2.2 or uninstalled
         └─restricted to versions 1 by Genie [c43c736e], leaving only versions 1.0.0-1.2.2
           └─Genie [c43c736e] log: see above
Stacktrace:
  [1] propagate_constraints!(graph::Pkg.Resolve.Graph, sources::Set{Int64}; log_events::Bool)
    @ Pkg.Resolve /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/Resolve/graphtype.jl:1072
  [2] propagate_constraints! (repeats 2 times)
    @ /Applications/Julia-1.8.app/Contents/Resources/julia/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 /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/Resolve/graphtype.jl:1533
  [4] simplify_graph! (repeats 2 times)
    @ /Applications/Julia-1.8.app/Contents/Resources/julia/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 /Applications/Julia-1.8.app/Contents/Resources/julia/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 /Applications/Julia-1.8.app/Contents/Resources/julia/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 /Applications/Julia-1.8.app/Contents/Resources/julia/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 /Applications/Julia-1.8.app/Contents/Resources/julia/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 /Applications/Julia-1.8.app/Contents/Resources/julia/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 /Applications/Julia-1.8.app/Contents/Resources/julia/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 /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/API.jl:156
 [12] add(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/API.jl:145
 [13] #add#27
    @ /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/API.jl:144 [inlined]
 [14] add
    @ /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/API.jl:144 [inlined]
 [15] #add#26
    @ /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/API.jl:143 [inlined]
 [16] add(pkg::String)
    @ Pkg.API /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/API.jl:143
 [17] top-level scope
    @ REPL[18]:1

I am using Julia version 1.8.3:

julia> VERSION
v"1.8.3"

I tried using registry rm General like in this question "Unsatisfiable requirements detected for the package" in Julia, but that doesn't work. So I was wondering if anyone knows how to fix this error?

Quinten
  • 35,235
  • 5
  • 20
  • 53

1 Answers1

2

The answer you linked is unfortunately not very helpful for the majority of "unsatisfiable requirements detected" errors - as you can see there, the error is actually that no version of a package are being found, even thought the package has a number of releases. This is indeed indicative of a corrupt local package registry.

Your case however is different: multiple different versions for all packages in the error message are being found, so there clearly isn't an issue with the registry.

Your question is basically a duplicate of the question I answered here:

Julia "Unsatisfiable requirements detected for package" error when installing multiple packages

which is the more common scenario for "unsatisfiable requirements" issues: you actually have unsatisfiable requirements in the sense that you are trying to install a set of packages into an environment which require incompatible versions of shared dependencies.

However, your issue seems to have a slight twist compared to the linked question above, check out what happens when I do what I did in the other answer and install the packages you're trying to install here (PlotlyJS and Genie) into a new environment:

(@v1.8) pkg> activate --temp
  Activating new project at `/tmp/jl_4HTNUi`

(jl_ox50Zr) pkg> add PlotlyJS Genie
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
(...)
    Updating `/tmp/jl_ox50Zr/Project.toml`
⌃ [c43c736e] + Genie v5.2.2
  [f0f68f2c] + PlotlyJS v0.18.10

No error, the operation resolved successfully and I now have Genie installed alongside PlotlyJS. Based on the error message above and my answer in the linked question above, I would have expected this to error so what's going on?

The clue is in two things:

  1. Note the little caret before the Genie entry in the Project.toml of the temporary environment above: ⌃ [c43c736e] + Genie v5.2.2 - this tells us that the Genie version installed is not the latest available version (a feature introduced in Julia 1.8); and

  2. Note this additional bit of info in your error message:

 │   │ └─Genie [c43c736e] log:
 │   │   ├─possible versions are: 5.13.0 or uninstalled
 │   │   └─Genie [c43c736e] is fixed to version 5.13.0

So the issue you're facing is not installing PlotlyJS and Genie per se, but rather adding PlotlyJS to an environment in which you specifically require Genie at version 0.5.13`. Let's confirm that that's the issue in a new temp environment:

(@v1.8) pkg> activate --temp
  Activating new project at `/tmp/jl_4HTNUi`

(jl_4HTNUi) pkg> add PlotlyJS Genie@5.13
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Mux [a975b10e]:
 Mux [a975b10e] log:
 ├─possible versions are: 0.4.0-1.0.1 or uninstalled
 ├─restricted by compatibility requirements with HTTP [cd3eb016] to versions: 1.0.0-1.0.1 or uninstalled
 │ └─HTTP [cd3eb016] log:
 │   ├─possible versions are: 0.6.10-1.6.2 or uninstalled
 │   └─restricted by compatibility requirements with Genie [c43c736e] to versions: 1.0.0-1.6.2
 │     └─Genie [c43c736e] log:
 │       ├─possible versions are: 0.9.4-5.13.0 or uninstalled
 │       └─restricted to versions 5.13 by an explicit requirement, leaving only versions 5.13.0
 └─restricted by compatibility requirements with Blink [ad839575] to versions: 0.4.0-0.7.6 — no versions left
   └─Blink [ad839575] log:
     ├─possible versions are: 0.8.0-0.12.5 or uninstalled

Which is a version of the error you're seeing. So indeed you are trying to do something that doesn't work: Genie 0.5.13 isn't compatible with PlotlyJS based on their respective dependencies, so you'll either have to work with an older Genie version, or a different plotting package, or change the compatibility bounds for PlotlyJS's dependencies to make things work (this is non-trivial, if you do so and things work you should consider making a PR upstream to allow everyone to access the updated version).

Nils Gudat
  • 13,222
  • 3
  • 39
  • 60