Pkg: Unsatisfiable requirements detected

I have this problem when trying to install AutoGrad.jl

(1.1) pkg>add AutoGrad
ERROR: Unsatisfiable requirements detected for package SIUnits [b9d75638]:
 SIUnits [b9d75638] log:
 ├─possible versions are: [0.0.1-0.0.6, 0.1.0] or uninstalled
 ├─restricted by compatibility requirements with Images [916415d5] to versions: [0.0.1-0.0.6, 0.1.0]
 │ └─Images [916415d5] log:
 │   ├─possible versions are: [0.2.0-0.2.50, 0.3.0-0.3.3, 0.4.0-0.4.50, 0.5.0-0.5.14, 0.6.0-0.6.1, 0.7.0, 0.8.0, 0.9.0-0.9.1, 0.10.0-0.10.1, 0.11.0-0.11.5, 0.12.0, 0.13.0, 0.14.0, 0.15.0-0.15.1, 0.16.0-0.16.1, 0.17.0-0.17.3] or uninstalled
 │   └─restricted to versions 0.17.2 by an explicit requirement, leaving only versions 0.17.2
 └─restricted by julia compatibility requirements to versions: uninstalled — no versions left

How can i fix this?, i want to remove SIUnits, but it isn’t in my project, so i can’t. Im looking for a way to remove that package

EDIT: solved, use gc

2 Likes

Could you please elaborate on how you solved this using gc? I’m a newcomer to the language and have had a slew of identical error messages upon each Pkg.add(“x”) call.

Possibly typing ] gc ENTER, which invokes the garbage collector.

I don’t understand why calling gc solves this. My understanding was that the packages deleted by gc were not being used anyway so conflicts with them would not cause errors. It seems like a problem to me that packages that would be deleted by gc can cause unsatisfiable requirements errors at all.

Calling pkg> gc can’t possibly have an effect on this. Multiple incompatible versions can be installed at the same time by design. They cannot, however, be in the same manifest at the same time.

2 Likes

That makes sense, but could you then clarify what gc does to the manifest? I was under the impression that it was deleting package versions which were omitted from the manifest.

It deletes package versions that are no longer referred to by any manifest of all the manifests recorded in the ~/.julia/logs/manifest_usage.toml log file.

1 Like

Updating your packages pkg> up can solve it. If not, do pkg> rm -m Package where Package is the problematic package. gc will not change anything indeed. I mean, it would be a bad garbage collector if it changed any behavior.

10 Likes

I am having no luck with either pkg> gc or pkg> up when encountering the same error:

(@v1.5) pkg> add JuMP
   Updating registry at `C:\Users\Max\.julia\registries\General`
  Resolving package versions...
ERROR: Unsatisfiable requirements detected for package x264_jll [1270edf5]:
 x264_jll [1270edf5] log:
 ├─x264_jll [1270edf5] has no known versions!
 └─restricted to versions * by an explicit requirement — no versions left

(@v1.5) pkg> gc
     Active manifests:
        `C:\Users\Max\.julia\environments\v1.5\Manifest.toml`
     Active artifacts:
        `C:\Users\Max\.julia\packages\Pixman_jll\U48xy\Artifacts.toml`
        `C:\Users\Max\.julia\packages\Libglvnd_jll\pJrjy\Artifacts.toml`
           ...
        `C:\Users\Max\.julia\packages\Libffi_jll\qmD6A\Artifacts.toml`
        `C:\Users\Max\.julia\packages\Xorg_xcb_util_jll\Ba3MF\Artifacts.toml`
    Deleted no artifacts, repos or packages

(@v1.5) pkg> add JuMP
  Resolving package versions...
ERROR: Unsatisfiable requirements detected for package x264_jll [1270edf5]:
 x264_jll [1270edf5] log:
 ├─x264_jll [1270edf5] has no known versions!
 └─restricted to versions * by an explicit requirement — no versions left

(@v1.5) pkg> up
   Updating registry at `C:\Users\Max\.julia\registries\General`
ERROR: Unsatisfiable requirements detected for package x264_jll [1270edf5]:
 x264_jll [1270edf5] log:
 ├─x264_jll [1270edf5] has no known versions!
 └─restricted to versions * by an explicit requirement — no versions left

I encountered a similar issue last week and the only solution was to delete the entire registry folder in Explorer. Then installing the new package worked, but took over an hour to recreate the registry files. Is there any better solution?

To my knowledge, this is a Windows problem. I regularly use different Julia versions and for each one I use a clean .julia folder, so I often reinstall the registries and its hardly takes a full minute.

However, if you create a new project/environment by using activate you should be able to achieve anything you achieved by recreating the registries just by installing the packages in this new environment in the right order (for you). No need to reinstall the registries for that.

2 Likes

I found an even simpler solution in simply doing pkg> rm x264_jll. I’m not sure what that package is supposed to do anyhow.