# Opam Local Library Install Missing Dependancy

**URL:** <https://discuss.ocaml.org/t/opam-local-library-install-missing-dependancy/13595>\
**Category:** Ecosystem\
**Tags:** opam, build, dune\
**Created:** [December 8, 2023, 3:47pm UTC](https://discuss.ocaml.org/t/opam-local-library-install-missing-dependancy/13595 "2023-12-08T15:47:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyocum](https://avatars.discourse-cdn.com/v4/letter/c/b5e925/32.png) [@cyocum](https://discuss.ocaml.org/u/cyocum)\
**Post date:** [December 8, 2023, 3:47pm UTC](https://discuss.ocaml.org/t/opam-local-library-install-missing-dependancy/13595/1 "2023-12-08T15:47:12Z")

</div>

I am currently working on a library using Dune and Opam to drive the compilation and development. I am able at the moment to build the library with the `dune-project` file below (I have removed identifying information that shouldn’t have any effect on the build):

```auto
(lang dune 3.11)

(name foo)

(generate_opam_files true)

(authors "...")

(maintainers "Maintainer Name")

(package
 (name foo)
 (synopsis "...")
 (description "...")
 (depends
	(dune (>= 3.11))
	(ocaml (= 5.1.1))
	(base (= 0.16.2))
	(ezcurl (= 0.2.4)))
 (tags
  (topics "to describe" your project)))

```

This builds fine and creates a opam project file like so:

```auto
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "..."
description: "..."
maintainer: ["Maintainer Name"]
authors: ["..."]
tags: ["topics" "to describe" "your" "project"]
depends: [
  "dune" {>= "3.11" & >= "3.11"}
  "ocaml" {= "5.1.1"}
  "base" {= "0.16.2"}
  "ezcurl" {= "0.2.4"}
  "odoc" {with-doc}
]
build: [
  ["dune" "subst"] {dev}
  [
    "dune"
    "build"
    "-p"
    name
    "-j"
    jobs
    "@install"
    "@runtest" {with-test}
    "@doc" {with-doc}
  ]
]

```

However, I want to use the library in Opam so I can use it in an executable. When I attempt this (`opam install .`), I get this error:

```auto
[NOTE] Ignoring uncommitted changes in
       /Users/(...)/(...)/(...) (`--working-dir'
       not active).
[foo.~dev] synchronised (no changes)
[ERROR] Package conflict!
  * Missing dependency:
    - base < v0.9.0
    no matching version

No solution found, exiting

```

As you can see, I am using Base 0.16.3 and not anything less. I attempted to run `opam upgrade --verbose` to see if I could figure out what was going on. I got this error:

```auto
Constructing initial basis...
Number of 0-1 knapsack inequalities = 9
Constructing conflict graph...
Conflict graph has 6 + 1 = 7 vertices
Everything as up-to-date as possible (run with --verbose to show unavailable
upgrades).
However, you may "opam upgrade" these packages explicitly, which will ask
permission to downgrade or uninstall the conflicting packages.
Nothing to do.

```

Additionally, while I was attempting to sort this out, I got this error:

```auto
Constructing initial basis...
Number of 0-1 knapsack inequalities = 9
Constructing conflict graph...
Conflict graph has 6 + 1 = 7 vertices
Everything as up-to-date as possible.
The following newer versions couldn't be installed:
  - ocamlbuild.0.14.2+win: unmet availability conditions: 'os = "win32"'
However, you may "opam upgrade" these packages explicitly, which will ask
permission to downgrade or uninstall the conflicting packages.
Nothing to do.

```

I am on a Mac so I am not sure why this was there at all. I tried to remove it but I couldn’t so I just removed ocamlbuild completely from my install to see if that would fix it (this also removed utop but I don’t really care about that right now). I have also completely re-initalized Opam because I thought maybe its state had somehow become corrupt but that led to the same situation. Also, I thought this might have to do with the machine I was running this on but I got the same error on a Linux machine that has a different install of Opam+Dune on it. I am kind of at the end of my knowledge on how to get this to work. Is there something that I am missing to install a local library that is under heavy development into Opam so I can use it else where? I am not sure what I did to mess up my Opam install as well. Any advice would be gratefully received.

---

<div class="post-metadata">

**Author:** ![kit-ty-kate](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/kit-ty-kate/32/5953_2.png) [@kit-ty-kate](https://discuss.ocaml.org/u/kit-ty-kate)\
**Post date:** [December 8, 2023, 7:47pm UTC](https://discuss.ocaml.org/t/opam-local-library-install-missing-dependancy/13595/2 "2023-12-08T19:47:26Z")

</div>

for legacy reasons JaneStreet packages all have a `v` prefix in them. So you’re trying to install `base.0.16.2` which doesn’t exists. Instead you should have:

```auto
  "base" {= "v0.16.2"}

```

That said, the bad error message is a known issue, I’ve added it to the ongoing discussion for the future fix: [Conflict messages · ocaml/opam · Discussion #5130 · GitHub](https://github.com/ocaml/opam/discussions/5130#discussioncomment-7803046)  
At the moment none of the opam maintainers have time to fix that but once opam 2.2.0 is out I should be able to look at it again.

---

<div class="post-metadata">

**Author:** ![cyocum](https://avatars.discourse-cdn.com/v4/letter/c/b5e925/32.png) [@cyocum](https://discuss.ocaml.org/u/cyocum)\
**Post date:** [December 8, 2023, 8:11pm UTC](https://discuss.ocaml.org/t/opam-local-library-install-missing-dependancy/13595/3 "2023-12-08T20:11:23Z")

</div>

Hi. Thanks for looking at this! I think that has done it. Thank you again.

Also, for anyone else who runs into this, opam checks your committed changes so if you make a quick change and you do not commit it, opam will not pick it up unless you set `--working-dir` like so `opam install --working-dir .`
