# \`StatsBase\` restricted from upgrading due to compatability constraints

**URL:** <https://discourse.julialang.org/t/statsbase-restricted-from-upgrading-due-to-compatability-constraints/98211>\
**Category:** Package Management\
**Tags:** package, compatibility\
**Created:** [May 2, 2023, 4:34pm UTC](https://discourse.julialang.org/t/statsbase-restricted-from-upgrading-due-to-compatability-constraints/98211 "2023-05-02T16:34:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Debartha\_Paul](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/debartha_paul/32/202192_2.png) [@Debartha\_Paul](https://discourse.julialang.org/u/Debartha_Paul)\
**Post date:** [May 2, 2023, 4:34pm UTC](https://discourse.julialang.org/t/statsbase-restricted-from-upgrading-due-to-compatability-constraints/98211/1 "2023-05-02T16:34:08Z")

</div>

I noticed that `StatsBase` received a version bump to `0.34.0` from `0.33.21` (was earlier from `0.33.22`). I tried to update all of my packages to the latest release, but `StatsBase` didn’t get updated. Here’s my `]st` after updating:

```julia
(@v1.8) pkg> st
Status `C:\Users\user\.julia\environments\v1.8\Project.toml`
  [6e4b80f9] BenchmarkTools v1.3.2
  [336ed68f] CSV v0.10.9
  [5ae59095] Colors v0.12.10
  [a93c6f00] DataFrames v1.5.0
  [31c24e10] Distributions v0.25.88
  [e30172f5] Documenter v0.27.24
  [38e38edf] GLM v1.8.2
  [09f84164] HypothesisTests v0.10.11
  [7073ff75] IJulia v1.24.0
  [ae8d54c2] Luxor v3.7.0
  [ee78f7c6] Makie v0.19.4
  [14b8a8f1] PkgTemplates v0.7.34
  [91a5bcdd] Plots v1.38.10
  [860ef19b] StableRNGs v1.0.0
  [82ae8749] StatsAPI v1.6.0
⌅ [2913bbd2] StatsBase v0.33.21
  [f3b207a7] StatsPlots v0.15.4
  [c1a98b4d] Survey v0.2.0
  [37e2e46d] LinearAlgebra
  [9a3f8284] Random
  [10745b16] Statistics
  [8dfed614] Test
Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated`

```

Upon running `status --outdated`, I found:

```julia
(@v1.8) pkg> status --outdated
Status `C:\Users\user\.julia\environments\v1.8\Project.toml`
⌅ [2913bbd2] StatsBase v0.33.21 (<v0.34.0): AlgebraOfGraphics, Clustering, GLM, HypothesisTests, KernelDensity, Makie, MultivariateStats, Plots, StatsPlots, Survey

```

I tried to force install `StatsBase v0.34.0` and there I came across the following error:

```julia
(@v1.8) pkg> add StatsBase@0.34.0
    Updating registry at `C:\Users\user\.julia\registries\General.toml`
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package StatsBase [2913bbd2]:
 StatsBase [2913bbd2] log:
 ├─possible versions are: 0.24.0-0.34.0 or uninstalled
 ├─restricted to versions 0.34.0 by an explicit requirement, leaving only versions 0.34.0
 └─restricted by compatibility requirements with HypothesisTests [09f84164] to versions: 0.24.0-0.33.21 — no versions left
   └─HypothesisTests [09f84164] log:
     ├─possible versions are: 0.7.0-0.10.11 or uninstalled
     └─restricted to versions * by an explicit requirement, leaving only versions 0.7.0-0.10.11

```

I cannot understand now why us this happening as according to latest releases, I have the latest release of `HypothesisTests`. Am I missing something trivial here?

Some help would be great…

```julia
julia> versioninfo()
Julia Version 1.8.5
Commit 17cfb8e65e (2023-01-08 06:45 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, tigerlake)
  Threads: 1 on 8 virtual cores
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS =

```

---

<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 2, 2023, 6:06pm UTC](https://discourse.julialang.org/t/statsbase-restricted-from-upgrading-due-to-compatability-constraints/98211/2 "2023-05-02T18:06:26Z")

</div>

I would have thought this is a rare case of a clear resolver message 🙂

```julia
StatsBase [2913bbd2] log:
 ├─possible versions are: 0.24.0-0.34.0 or uninstalled
 ├─restricted to versions 0.34.0 by an explicit requirement, leaving only versions 0.34.0
 └─restricted by compatibility requirements with HypothesisTests [09f84164] to versions: 0.24.0-0.33.21 

```

`HypothesisTests` restricts compatibility with `StatsBase` to version 0.33, so you can’t have `HypothesisTests` and `StatsBase@0.34` in the same environment. 0.34 just came out and is a breaking release, so it’ll take some time for all dependents to check they’re okay with the breaking changes in StatsBase and update their compat bounds.

---

<div class="post-metadata">

**Author:** ![Debartha\_Paul](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/debartha_paul/32/202192_2.png) [@Debartha\_Paul](https://discourse.julialang.org/u/Debartha_Paul)\
**Post date:** [May 2, 2023, 6:32pm UTC](https://discourse.julialang.org/t/statsbase-restricted-from-upgrading-due-to-compatability-constraints/98211/3 "2023-05-02T18:32:55Z")

</div>

So, just for testing, shall I try updating `StatsBase` after removing `HypothesisTests` from this environment, and see if that works?

---

<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 2, 2023, 7:46pm UTC](https://discourse.julialang.org/t/statsbase-restricted-from-upgrading-due-to-compatability-constraints/98211/4 "2023-05-02T19:46:33Z")

</div>

Yes if you need StatsBase 0.34 in your default environment, HypothesisTests has to go.

(generally speaking that’s why you shouldn’t install all your packages in the default environment, but work in project environments instead, although in this case I appreciate that having StatsBase and HypothesisTests in the same environment is quite a common thing)

---

<div class="post-metadata">

**Author:** ![palday](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palday/32/12640_2.png) [@palday](https://discourse.julialang.org/u/palday)\
**Post date:** [May 2, 2023, 8:55pm UTC](https://discourse.julialang.org/t/statsbase-restricted-from-upgrading-due-to-compatability-constraints/98211/5 "2023-05-02T20:55:36Z")

</div>

There is now a [registration pull request](https://github.com/JuliaRegistries/General/pull/82748) open to update HypothesisTests, so you should be able to install it in like 20 minutes.

The other packages are less under my control, but I’ll have [MultivariateStats](https://github.com/JuliaStats/MultivariateStats.jl/pull/218) and [KernelDensity](https://github.com/JuliaStats/KernelDensity.jl/pull/116) updated shortly. I’ve opened a [PR against AoG](https://github.com/MakieOrg/AlgebraOfGraphics.jl/pull/458).

StatsBase 0.34 was technically breaking in the sense that certain type aliases were removed that we didn’t expect other packages were using. But beyond that, all functionality from 0.33 should still work, so it should be an easy compat bump for most packages.

---

<div class="post-metadata">

**Author:** ![Debartha\_Paul](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/debartha_paul/32/202192_2.png) [@Debartha\_Paul](https://discourse.julialang.org/u/Debartha_Paul)\
**Post date:** [May 4, 2023, 2:57pm UTC](https://discourse.julialang.org/t/statsbase-restricted-from-upgrading-due-to-compatability-constraints/98211/6 "2023-05-04T14:57:23Z")

</div>

Looks like I’ll either have to wait till all of the packages in my current environment, which has `StatsBase` as one of it’s dependencies, get a compat bump or load `StatsBase` in a different environment, independent of those other packages.

---

<div class="post-metadata">

**Author:** ![palday](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palday/32/12640_2.png) [@palday](https://discourse.julialang.org/u/palday)\
**Post date:** [May 4, 2023, 2:58pm UTC](https://discourse.julialang.org/t/statsbase-restricted-from-upgrading-due-to-compatability-constraints/98211/7 "2023-05-04T14:58:27Z")

</div>

For what it’s worth … there aren’t really any new features in the new release, just a few small fixes. It’s technically breaking because some type aliases were removed.

---

<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 4, 2023, 6:46pm UTC](https://discourse.julialang.org/t/statsbase-restricted-from-upgrading-due-to-compatability-constraints/98211/8 "2023-05-04T18:46:03Z")

</div>

There was apparently some changes in the treatment of NaNs and Infs for weights.
