Julia Package dependencies in Travis CI - julia

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).

Related

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

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!

How to install the latest version of Flux.jl?

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.

Fail to install CUDA, Flux, CuArrays etc, pls advise - Julia packages

I am new to Julia, when trying to add CUDA, comes the error as following.
It seems meaning the CuArrays is not in right condition, so I add the CuArrays from the github, then it comes another error about Adapt.
When adding Adapt, it seems fine, but when rolling back, the Adapt issue comes again.
Just like rabbit holes in Alice's dream, I am stucked here and don't know what to do to make it work.
Please advise, Thanks,
BTW, the CUDA path is set.
OS:Win10
JuliaPro 1.5.0
GPU: NVIDIA MX150
CUDA.jl
(#JuliaPro_v1.5.0-1) pkg> add https://github.com/JuliaGPU/CUDA.jl
Updating git-repo `https://github.com/JuliaGPU/CUDA.jl`
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package CUDAnative [be33ccc6]:
CUDAnative [be33ccc6] log:
├─possible versions are: [0.7.0, 0.8.0-0.8.10, 0.9.0-0.9.1, 0.10.0-0.10.1, 1.0.0-1.0.1, 2.0.0-2.0.1, 2.1.0-2.1.3, 2.2.0-2.2.1, 2.3.0-2.3.1, 2.4.0, 2.5.0-2.5.5, 2.6.0, 2.7.0, 2.8.0-2.8.1, 2.9.0-2.9.1, 2.10.0-2.10.2, 3.0.0-3.0.4, 3.1.0, 3.2.0] or uninstalled
├─restricted to versions * by an explicit requirement, leaving only versions [0.7.0, 0.8.0-0.8.10, 0.9.0-0.9.1, 0.10.0-0.10.1, 1.0.0-1.0.1, 2.0.0-2.0.1, 2.1.0-2.1.3, 2.2.0-2.2.1, 2.3.0-2.3.1, 2.4.0, 2.5.0-2.5.5, 2.6.0, 2.7.0, 2.8.0-2.8.1, 2.9.0-2.9.1, 2.10.0-2.10.2, 3.0.0-3.0.4, 3.1.0, 3.2.0]
└─restricted by compatibility requirements with LLVM [929cbde3] to versions: uninstalled — no versions left
└─LLVM [929cbde3] log:
├─possible versions are: [0.9.0-0.9.15, 1.0.0, 1.1.0-1.1.1, 1.2.0, 1.3.0-1.3.4, 1.4.0-1.4.1, 1.5.0-1.5.2, 1.6.0, 1.7.0, 2.0.0, 3.0.0] or uninstalled
└─restricted to versions 3 by CUDA [052768ef], leaving only versions 3.0.0
└─CUDA [052768ef] log:
├─possible versions are: 1.3.0 or uninstalled
└─CUDA [052768ef] is fixed to version 1.3.0
CUDAnative
(#JuliaPro_v1.5.0-1) pkg> add https://github.com/JuliaGPU/CUDAnative.jl
Updating git-repo `https://github.com/JuliaGPU/CUDAnative.jl`
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Adapt [79e6a3ab]:
Adapt [79e6a3ab] log:
├─possible versions are: 2.3.0 or uninstalled
├─restricted to versions [0.4, 1] by CUDAnative [be33ccc6] — no versions left
│ └─CUDAnative [be33ccc6] log:
│ ├─possible versions are: 3.1.0 or uninstalled
│ └─CUDAnative [be33ccc6] is fixed to version 3.1.0
└─Adapt [79e6a3ab] is fixed to version 2.3.0
Adapt
(#JuliaPro_v1.5.0-1) pkg> add https://github.com/JuliaGPU/Adapt.jl
Updating git-repo `https://github.com/JuliaGPU/Adapt.jl`
Resolving package versions...
No Changes to `C:\Users\eric1\.julia\environments\JuliaPro_v1.5.0-1\Project.toml`
No Changes to `C:\Users\eric1\.julia\environments\JuliaPro_v1.5.0-1\Manifest.toml`
You should be installing packages:
(#JuliaPro_v1.5.0-1) pkg> add CUDA
If you are doing instead add https://github.com/JuliaGPU/CUDA.jl you are installing the latest development version (master branch) from the repository.
Since it is a development (current-state-of-source-code) version quite likely something might not work.
Now, I recommend you to remove all those dev package versions that you have installed (so run rm package manager commad) and then reinstall their release versions rather than dev versions.
There is a good change that after that you will not have a dependency clash.

ERROR: Unsatisfiable requirements detected for package when using 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.

Using Avro Julia Package

It seems like there is some simple version mismatch occuring when trying to use Julia 1.0+ with this older package.
pkg> add Avro
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Avro [cb912096]:
Avro [cb912096] log:
├─possible versions are: 0.0.1-0.0.3 or uninstalled
├─restricted to versions * by an explicit requirement, leaving only versions 0.0.1-0.0.3
└─restricted by julia compatibility requirements to versions: uninstalled — no versions left
Is there a way to use Compat or to update the Avro package so it will work in Julia 1.0?

Resources