I am trying to solve this issue.
I understand that my version of the package is outdated (v1.7.2).
However, the package manager thinks I'm on the up-to-date version (v2.3.1).
(#v1.7) pkg> up
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`
(#v1.7) pkg> st Parsers
Status `~/.julia/environments/v1.7/Project.toml`
[69de0a69] Parsers v2.3.1
julia> using Parsers
julia> Parsers.VERSION
v"1.7.2"
If I uninstall/reinstall the problem is still there:
(#v1.7) pkg> rm Parsers
Updating `~/.julia/environments/v1.7/Project.toml`
[69de0a69] - Parsers v2.3.1
No Changes to `~/.julia/environments/v1.7/Manifest.toml`
julia> using Parsers
│ Package Parsers not found, but a package named Parsers is available from a registry.
│ Install package?
│ (#v1.7) pkg> add Parsers
└ (y/n) [y]: y
Resolving package versions...
Updating `~/.julia/environments/v1.7/Project.toml`
[69de0a69] + Parsers v2.3.1
No Changes to `~/.julia/environments/v1.7/Manifest.toml`
julia> using Parsers
julia> Parsers.VERSION
v"1.7.2"
PackageName.VERSION, in contrast to what it intuitively looks like, does not give you the version of the package - it gives you the version of Julia currently installed. So v"1.7.2" refers to your installed version of Julia - you can verify this by loading any other package and trying LoadedPackage.VERSION on them, which should return the same value. (I'm not sure about the reason for such a design - having VERSION be a member of every module - but perhaps there's some value in VERSION being available as a local name within every module namespace.)
So you do have version 2.3.1 of Parsers installed, as the package manager indicates. The source of your original problem must be something else - perhaps it's worth asking as a separate question.
Related
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`
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.
Understanding the error message
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.
Workarounds
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.
Specific comment on JuliaDB
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!
I am trying to install the latest version of Flux.jl with Julia 1.6. When I do add Flux, it adds version Flux v0.8.3 but looking at GitHub, it seems the newest release is version 0.12.x. I have the following packages in my env:
(#v1.6) pkg> st
Status `~/.julia/environments/v1.6/Project.toml`
[5ae59095] Colors v0.9.6
[8f4d0f93] Conda v1.5.2
[7876af07] Example v0.5.3
[587475ba] Flux v0.8.3
[7073ff75] IJulia v1.23.2
[91a5bcdd] Plots v1.0.14
I tried removing Flux and re-adding it already. I also tried:
(#v1.6) pkg> up Flux
Updating registry at `~/.julia/registries/General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`
Updating registry at `~/.julia/registries/JuliaPOMDP`
Updating git-repo `https://github.com/JuliaPOMDP/Registry`
No Changes to `~/.julia/environments/v1.6/Project.toml`
No Changes to `~/.julia/environments/v1.6/Manifest.toml`
and I tried adding the specific version I wanted:
(#v1.6) pkg> add Flux#v0.12.4
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package CodecZlib [944b1d66]:
CodecZlib [944b1d66] log:
├─possible versions are: 0.4.4-0.7.0 or uninstalled
├─restricted by compatibility requirements with StackOverflow [1a8df32f] to versions: 0.6.0
│ └─StackOverflow [1a8df32f] log:
│ ├─possible versions are: 0.1.0-0.1.2 or uninstalled
│ └─restricted to versions * by an explicit requirement, leaving only versions 0.1.0-0.1.2
└─restricted by compatibility requirements with Flux [587475ba] to versions: 0.7.0 — no versions left
└─Flux [587475ba] log:
├─possible versions are: 0.4.1-0.12.4 or uninstalled
└─restricted to versions 0.12.4 by an explicit requirement, leaving only versions 0.12.4
which resulted in the error above.
Somehow one of those other packages listed above was causing the Flux version to be upper bounded at v0.8.3 (I am guessing Conda but am not sure). By removing all the packages besides IJulia, I was able to do an up Flux and have it go to [587475ba] ↑ Flux v0.8.3 ⇒ v0.12.4.
I had used Julia some months back for a project, and didn't use it since. I hadn't faced problems back then. But now, I absolutely am not able to install any package.
(#v1.5) pkg> add Distributions
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Distributions [31c24e10]:
Distributions [31c24e10] log:
├─Distributions [31c24e10] has no known versions!
└─restricted to versions * by an explicit requirement — no versions left
Any package I install, I am getting the same error. How do I fix it?
This is the status of Pkg:
(#v1.5) pkg> status
Status `C:\Users\jaine\.julia\environments\v1.5\Project.toml`
[6e4b80f9] BenchmarkTools v0.5.0
[7073ff75] IJulia v1.21.2
[91a5bcdd] Plots v1.6.0
[438e738f] PyCall v1.91.4
[d330b81b] PyPlot v2.9.0
[2913bbd2] StatsBase v0.33.0
Given
├─Distributions [31c24e10] has no known versions!
it looks like you have a missing or corrupt package registry. The package manager will reinstall it for you if you delete .julia/registries and try to add the package again.
You can do this from within julia
rm(joinpath(homedir(), ".julia", "registries"), recursive=true, force=true)
These are indeed some of the more tricky situations to resolve so please bear with me as we work through this.
If you are not familiar with the basics of the package manager, it's worth a quick read to check out: https://julialang.github.io/Pkg.jl/v1/getting-started/
Assuming you are now in the Julia Repl, my general work flow for these issues is to remove everything it warns me about. The core problem here is that one of your existing packages is saying it needs a specific version of Distributions.jl but it's not able to add it. So, the first step would be to enter the pkg manager by doing ] and type rm Distributions.
Then, while still in the pkg mode, do resolve and add Distributions.
So the process is to just remove each package the Repl complains about until it stops complaining.
Note: If you run into something like this again, the worst-case scenario is to remove the project and manifest files for the specific Julia version you are using. If you navigate to ".julia/environments" you should be able to completely reset the Julia Env for a specific version there (that way you don't need to actually reinstall Julia).
I am trying to dev a package I already have locally installed because I am updating my Julia version.
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package NameOfPackage [980c2a51]:
NameOfPackage [980c2a51] log:
├─ NameOfPackage [980c2a51] has no known versions!
└─restricted to versions * by NameOfOtherPackage [e09632b2] — no versions left
However, when I do ] st, I get [afad1059] NameOfPackage v0.2.0 [~/.julia/dev/NameOfPackage]
How can NameOfPackage have no known versions but show a version?
There is a UUID mismatch (one UUID starts with “980c” and one with “afad”) so this looks like two different packages to the resolver. You need to figure out which is the correct one and remove all traces of the wrong UUID.
I am trying to use Travis on a package of mine (UnivariateFunctions) that depends on another package (SchumakerSpline). The build always fails, apparently because it cannot access SchumakerSpline. SchumakerSpline can be installed from github to my local machine via REPL so it is not clear what the problem with this package is.
What can cause an error of this sort and more generally what are the required steps for using Travis to test a Julia package that is dependent on other Julia packages? What do you need to do with a package to ensure it can be easily referenced and depended on by other packages?
The full error message is below:
ERROR: Unsatisfiable requirements detected for package SchumakerSpline [65e68595]:
SchumakerSpline [65e68595] log:
├─possible versions are: 0.0.1 or uninstalled
├─restricted to versions 0.0.1-* by UnivariateFunctions [117ba14f], leaving only versions 0.0.1
│ └─UnivariateFunctions [117ba14f] log:
│ ├─possible versions are: 0.0.0 or uninstalled
│ └─UnivariateFunctions [117ba14f] is fixed to version 0.0.0
└─restricted by julia compatibility requirements to versions: uninstalled — no versions left
This:
restricted by julia compatibility requirements
means that the package (SchumakerSpline) does not support the Julia version you are running.
It seem that the developer of SchumakerSpline did not jet make a new release for Julia 1.0. You might want to make an issue on their repo. Beside this you can also use Pkg.clone on Travis CI to have the latest version of SchumakerSpline (which seems to support 1.0).