Reputation: 31
I'm using Julia v1.5.2 and I got the below error when I tried to install EvalMetrics:
Pkg.add("EvalMetrics")
I even tried using the Pkg manager instead of using import Pkg, but it doesn't seem to make a difference either.
Unsatisfiable requirements detected for package StatsBase [2913bbd2]:
StatsBase [2913bbd2] log:
├─possible versions are: 0.24.0-0.33.19 or uninstalled
├─restricted to versions * by an explicit requirement, leaving only versions 0.24.0-0.33.19
├─restricted by compatibility requirements with JuliaDB [a93385a2] to versions: 0.24.0-0.32.2
│ └─JuliaDB [a93385a2] log:
│ ├─possible versions are: 0.9.0-0.13.1 or uninstalled
│ └─restricted to versions * by an explicit requirement, leaving only versions 0.9.0-0.13.1
└─restricted by compatibility requirements with EvalMetrics [251d5f9e] to versions: 0.33.0-0.33.19 — no versions left
└─EvalMetrics [251d5f9e] log:
├─possible versions are: 0.1.0-0.2.1 or uninstalled
└─restricted to versions 0.1.1 by an explicit requirement, leaving only versions 0.1.1
and when i tried to update StatsBase
, it is up to date and i got this:
Updating registry at `~/.julia/registries/General.toml`
No Changes to `~/.julia/environments/v1.7/Project.toml`
No Changes to `~/.julia/environments/v1.7/Manifest.toml`
Upvotes: 3
Views: 1072
Reputation: 13800
I'll start by saying don't use Julia 1.5.2 - the current stable release is 1.7.3, and we will soon get 1.8.0, and it's generally adviseable to use the latest stable release (or an LTS if you don't want to make any changes to you environment but still receive bugfixes).
That said, the error you're seeing is unrelated to the Julia version. Here's a minimal reproducer in a clean temporary environment (] activate --temp
):
(jl_0jYGBJ) pkg> add JuliaDB EvalMetrics
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package StatsBase [2913bbd2]:
StatsBase [2913bbd2] log:
├─possible versions are: 0.24.0-0.33.19 or uninstalled
├─restricted by compatibility requirements with JuliaDB [a93385a2] to versions: 0.24.0-0.32.2
│ └─JuliaDB [a93385a2] log:
│ ├─possible versions are: 0.9.0-0.13.1 or uninstalled
│ └─restricted to versions * by an explicit requirement, leaving only versions 0.9.0-0.13.1
└─restricted by compatibility requirements with EvalMetrics [251d5f9e] to versions: 0.33.0-0.33.19 — no versions left
└─EvalMetrics [251d5f9e] log:
├─possible versions are: 0.1.0-0.2.1 or uninstalled
└─restricted to versions * by an explicit requirement, leaving only versions 0.1.0-0.2.1
Given that these unsatisfiable requirements
errors are reasonably common, I'll try to go through the error message step by step as it can sometimes be daunting for new users to parse, before discussing possible workarounds and commenting on your specific version clash at the end.
What's happening here? I'm trying to add JuliaDB
and EvalMetrics
to this new environment, so the Pkg resolver tries to determine the most up to date versions of both packages which will work together. In this instance, the attempt fails - there are no compatible versions of JuliaDB
and EvalMetrics
which can coexist. This is because they both depend on StatsBase
, but require non-overlapping version numbers of this package. Here's how to read the error message:
StatsBase [2913bbd2] log:
├─possible versions are: 0.24.0-0.33.19 or uninstalled
This just tells us that versions 0.24 to 0.33.19 exist in the General registry and can be installed.
Next the message tells us which versions are allowed by the different packages we're adding to the environment:
├─restricted by compatibility requirements with JuliaDB [a93385a2] to versions: 0.24.0-0.32.2
so JuliaDB
works at most with StatsBase
version 0.32.2, and does not admit any newer versions.
The next part tells us the restrictions placed on the installation of JuliaDB
itself:
│ └─JuliaDB [a93385a2] log:
│ ├─possible versions are: 0.9.0-0.13.1 or uninstalled
│ └─restricted to versions * by an explicit requirement, leaving only versions 0.9.0-0.13.1
This just tells us that JuliaDB has versions 0.9-0.13.1 available, and that we have asked for any JuliaDB
version to be installed (restricted to versions * by an explicit requirement
means all versions are allowed, but the package has to be installed as we explicitly asked for it).
So we have required JuliaDB
, and JuliaDB
tells us that it only works with StatsBase
up to version 0.32.2. Why is this a problem? Look at the next part of the error:
└─restricted by compatibility requirements with EvalMetrics [251d5f9e] to versions: 0.33.0-0.33.19 — no versions left
EvalMetrics
only works with StatsBase
versions 0.33.0 and up - which is disallowed by JuliaDB
.
So what's to do? It's not clear from your question, but frequently these errors appear where users dump all packages they are installing into their default environment ((@v1.5)
in your case). As the number of packages in the default environment goes up, so does the likelihood that any two packages share some dependency and require incompatible versions of that dependency.
Therefore the first "workaround" is to work in project specific environments - there's a good explainer in the Pkg.jl documentation here. In short, make a new folder for whatever analysis you're working on and do ] activate .
in that folder to start a new environment to which you only add the specific packages needed for that analysis. (There are other benefits to this, the most important imho being reproducibility of your analysis, but these are unrelated to your question).
In this case, if you don't actually need JuliaDB
and EvalMetrics
at the same time, you can just make two environments and avoid the conflict.
What if you do actually need two packages which are incompatible with each other? In this case, a relaxation of the compatibility requirements of one of the packages is needed (often referred to as "bumping the compat bounds" of a package. Two ways to go about this:
The easy way (which might take a while though!) is to file an issue on the repo of one of the packages involved. In this case it would likely be JuliaDB, and indeed that issue already exists (more on this later)
The harder (but likely faster) way is to just do it yourself - often packages are unaffected by a version change in one of their dependencies, as they didn't actually rely on the functionality of the dependency that broke in the update. To check whether this is the case, you can ]dev
the package and update the dependency, then see whether it still works. If it doesn't you can try updating the package as necessary and make a PR to upstream your changes. I'm not going to pretend that this is easy or a "normal" thing that's expected of Julia users, but I will say that developing Julia packages is comparatively easy (as most things are written in all Julia, no hidden C/C++ code like in R/Python), and the community is likely to receive such an attempt of a new user well and help you out where they can - just post on the Julia Discourse if you get stuck.
I noted above that the issue asking for a bump of the version bound for StatsBase
already exists in the JuliaDB
repo. You'll also see that the issue is quite old (almost a year at this point), and if you check the [Project.toml](https://github.com/JuliaData/JuliaDB.jl/blob/main/Project.toml)
file, which sets the compat bounds, on the main branch you'll also see that there's been a PR 16 months ago to bump those bounds, but no new version has been released since 2020.
That is to say, you happened on a package which has effectively abandoned - see a related issue here which advises users to switch to Dagger.jl to work with large distributed tables.
If you're now thinking "wait did I just read through all this only to find out that I shouldn't be using JuliaDB
" then I suppose you're right, although I hope that the rest of the answer contained useful information which will help you with future compat issues!
Upvotes: 6