I'm using Julia v1.5.2 and using this code to add the Plots package

import Pkg
Pkg.add("Plots")

And I'm getting an error message that is given below.
I've tried reinstalling Julia and also tried the other stable version (v1.0), but I'm still getting the same type of error message. I even tried using the Pkg manager instead of using import Pkg, but it doesn't seem to make a difference either.

ERROR: Unsatisfiable requirements detected for package HTTP [cd3eb016]:
 HTTP [cd3eb016] log:
 ├─HTTP [cd3eb016] has no known versions!
 └─found to have no compatible versions left with Pluto [c3e4b0f8]
   └─Pluto [c3e4b0f8] log:
     ├─possible versions are: [0.2.0, 0.3.0-0.3.6, 0.4.0-0.4.3, 0.5.0-0.5.21, 0.6.0-0.6.4, 0.7.0-0.7.10, 0.8.0-0.8.10, 0.9.0-0.9.11, 0.10.0-0.10.13, 0.11.0-0.11.14, 0.12.0-0.12.3] or uninstalled
     └─restricted to versions * by an explicit requirement, leaving only versions [0.2.0, 0.3.0-0.3.6, 0.4.0-0.4.3, 0.5.0-0.5.21, 0.6.0-0.6.4, 0.7.0-0.7.10, 0.8.0-0.8.10, 0.9.0-0.9.11, 0.10.0-0.10.13, 0.11.0-0.11.14, 0.12.0-0.12.3]
Stacktrace:
 [1] propagate_constraints!(::Pkg.Resolve.Graph, ::Set{Int64}; log_events::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Resolve\graphtype.jl:1005
 [2] propagate_constraints! at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Resolve\graphtype.jl:946 [inlined] (repeats 2 times)
 [3] simplify_graph!(::Pkg.Resolve.Graph, ::Set{Int64}; clean_graph::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Resolve\graphtype.jl:1460
 [4] simplify_graph! at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Resolve\graphtype.jl:1460 [inlined] (repeats 2 times)
 [5] resolve_versions!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:375
 [6] targeted_resolve at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:1114 [inlined]
 [7] tiered_resolve(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:1100
 [8] _resolve at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:1120 [inlined]
 [9] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}, ::Array{Base.UUID,1}; preserve::Pkg.Types.PreserveLevel, platform::Pkg.BinaryPlatforms.Windows) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\Operations.jl:1135
 [10] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; preserve::Pkg.Types.PreserveLevel, platform::Pkg.BinaryPlatforms.Windows, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:188
 [11] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:139
 [12] #add#21 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:67 [inlined]
 [13] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:67 [inlined]
 [14] #add#20 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:66 [inlined]
 [15] add at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:66 [inlined]
 [16] add(::String; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:65
 [17] add(::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Pkg\src\API.jl:65
 [18] top-level scope at REPL[19]:1
2

There are 2 best solutions below

5
Przemyslaw Szufel On BEST ANSWER

Try to remove Pluto

using Pkg
pkg"rm Pluto"
pkg"add Plots"

Then update the packages:

pkg"update"

I would also now try to explicitly install Http and check it version:

pkg"add HTTP"
pkg"status HTTP"

Pluto seems to require at least HTTP version 0.8.8 which does not look like anything special. So now you should be able to install back Pluto

pkg"add Pluto"

If anything goes wrong please write it. For sure Pluto is working together with Plots. This is my package status here (you could provide similar info):

julia> Pkg.status.(["Pluto","HTTP","Plots"]);
Status `C:\JuliaPkg\Julia1.5.2\environments\v1.5\Project.toml`
  [c3e4b0f8] Pluto v0.12.3
Status `C:\JuliaPkg\Julia1.5.2\environments\v1.5\Project.toml`
  [cd3eb016] HTTP v0.8.19
Status `C:\JuliaPkg\Julia1.5.2\environments\v1.5\Project.toml`
  [91a5bcdd] Plots v1.6.9

Sometimes some other package might be holding down versions of everything.

0
spacetyper On

] update Pluto (or the name of the dependency causing this problem)

Then try again: ] add Plots

Explanation:

In the situation where the problem is caused by a dependency (here, Pluto) with a restriction of restricted to versions ... by an explicit requirement, the explicit requirement is likely due to that dependency (Pluto) itself. So you can simply update that dependency (Pluto) independently before updating the upstream packages (HTTP or Plots):