ERROR: Unsatisfiable requirements detected and has no known versions!

I am getting the same error in my case Xnumber is a dependency of SHbundle and both of them are unregistered.

ERROR: Unsatisfiable requirements detected for package Xnumber [fdc6275c]:
 Xnumber [fdc6275c] log:
 ├─Xnumber [fdc6275c] has no known versions!
 └─restricted to versions * by SHbundle [685399a2] — no versions left
   └─SHbundle [685399a2] log:
     ├─possible versions are: 0.1.0 or uninstalled
     └─SHbundle [685399a2] is fixed to version 0.1.0

Also I have added Xnumber to SHbundle but when i run the following command in gitlab-ci i get the above error.

- |
      julia --project=docs -e '
        using Pkg
        Pkg.Registry.update()
        Pkg.develop(PackageSpec(path=pwd()))
        Pkg.instantiate()
        using Documenter: doctest
        using SHbundle
        doctest(SHbundle)
        include("docs/make.jl")'

I don’t know how much the below answer is relevant to my case as could not understand the solution.

https://discourse.julialang.org/t/package-manager-resolve-complaining-of-unsatisfiable-requirements-due-to-no-known-versions/23778?u=vyush_agarwal

Link to gitlab repos:
SHbundle
Xnumber => https://gitlab.com/vyush/Xnumber.jl

My understanding is that you are trying to execute the above command in the SHbundle folder.

The problem is that Pkg.instantiate() is not going to work since it does not know how to find Xnumber.

Before instantiating you should Pkg.develop(url="https://gitlab.com/vyush/Xnumber.jl") first.

Try this:

        using Pkg
        Pkg.Registry.update()
        Pkg.develop(url="https://gitlab.com/vyush/Xnumber.jl")
        Pkg.develop(PackageSpec(path=pwd())) # I'm assuming we are in the SHbundle directory
        Pkg.instantiate()
        using Documenter: doctest
        using SHbundle
        doctest(SHbundle)
        include("docs/make.jl")
1 Like

Thank you. This does solve the error but why does the

Pkg.develop(PackageSpec(path=pwd())) 

not take the path to Xnumber from the manifest.yml

You are pointing at the docs project, so the relevant Manifest is docs/Manifest.toml · master · Vyush Agarwal / SHbundle.jl · GitLab

I do not see the path to Xnumber there. Also it is my rough understanding that Manifest.toml is mainly used by Pkg.instantiate(), but I may be wrong on this.

1 Like

Okay, that makes sense.Thanks.

This was very helpful for a single unregistered package, but any chance there is a fix for multiple unregistered packages? I tried adding Pkg.develop(url="...") where ... is the github url for each of my unregistered packages before calling Pkg.develop(PackageSpec(path=pwd())) . It seems only the first package is found and the others throw the same Error: Unsatisfiable requirements detected and has no known versions.

Pkg.develop will accept a Vector{PackageSpec}. Thus you could do

using Pkg
Pkg.develop([PackageSpec(url="..."), PackageSpec(url="..."), ..., PackageSpec(url="...")])

See the docstrings for Pkg.develop and PackageSpec:

help?> Pkg.develop
  Pkg.develop(pkg::Union{String, Vector{String}}; io::IO=stderr)
  Pkg.develop(pkgs::Union{Packagespec, Vector{Packagespec}}; io::IO=stderr)

  Make a package available for development by tracking it by path. If pkg is given with only a name or by a URL, the package will be downloaded to the location specified by the environment variable
  JULIA_PKG_DEVDIR, with joinpath(DEPOT_PATH[1],"dev") being the default.

  If pkg is given as a local path, the package at that path will be tracked.

  Examples
  ≡≡≡≡≡≡≡≡≡≡

  # By name
  Pkg.develop("Example")
  
  # By url
  Pkg.develop(url="https://github.com/JuliaLang/Compat.jl")
  
  # By path
  Pkg.develop(path="MyJuliaPackages/Package.jl")

  See also PackageSpec, Pkg.add.

help?> PackageSpec
search: PackageSpec

  PackageSpec(name::String, [uuid::UUID, version::VersionNumber])
  PackageSpec(; name, url, path, subdir, rev, version, mode, level)

  A PackageSpec is a representation of a package with various metadata. This includes:

    •  The name of the package.

    •  The package's unique uuid.

    •  A version (for example when adding a package). When upgrading, can also be an instance of the enum UpgradeLevel.

    •  A url and an optional git revision. rev can be a branch name or a git commit SHA1.

    •  A local path. This is equivalent to using the url argument but can be more descriptive.

    •  A subdir which can be used when adding a package that is not in the root of a repository.

  Most functions in Pkg take a Vector of PackageSpec and do the operation on all the packages in the vector.

  │ Julia 1.5
  │
  │  Many functions that take a PackageSpec or a Vector{PackageSpec} can be called with a more concise notation with NamedTuples. For example, Pkg.add can be called either as the explicit or
  │  concise versions as:
  │
  │  Explicit                                                          Concise                                      
  │  ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– –––––––––––––––––––––––––––––––––––––––––––––
  │  Pkg.add(PackageSpec(name="Package"))                              Pkg.add(name = "Package")                    
  │  Pkg.add(PackageSpec(url="www.myhost.com/MyPkg")))                 Pkg.add(name = "Package")                    
  │  Pkg.add([PackageSpec(name="Package"), PackageSpec(path="/MyPkg"]) Pkg.add([(;name="Package"), (;path="MyPkg")])

  Below is a comparison between the REPL mode and the functional API:

  REPL               API                                                
  –––––––––––––––––– –––––––––––––––––––––––––––––––––––––––––––––––––––
  Package            PackageSpec("Package")                             
  Package@0.2        PackageSpec(name="Package", version="0.2")         
  Package=a67d...    PackageSpec(name="Package", uuid="a67d...")        
  Package#master     PackageSpec(name="Package", rev="master")          
  local/path#feature PackageSpec(path="local/path"; rev="feature")      
  www.mypkg.com      PackageSpec(url="www.mypkg.com")                   
  --major Package    PackageSpec(name="Package", version=PKGLEVEL_MAJOR)