utop icon indicating copy to clipboard operation
utop copied to clipboard

Fatal error: exception Fl_package_base.No_such_package("utop", "")

Open akiradeveloper opened this issue 10 years ago • 4 comments

I have installed utop via opam (opam install utop) before. It was working.

After opam-installing some packages, utop got into trouble. The command is located under .opam/4.01.0/bin/ but kicking it invokes the error

Fatal error: exception Fl_package_base.No_such_package("utop", "")

It seems utop isn't found under .opam/4.01.0/lib/utop/ and it's actually empty.

I tried reinstalling utop (opam reinstall utop) but it remains empty still.

I guess something bad happens in installing the utop library. Do you have some idea? I tried 4.02.1 but the result was the same as 4.01.0.

akiradeveloper avatar Nov 08 '14 10:11 akiradeveloper

This look like an opam problem, either a missing eval $(opam config env) or another opam problem.

Can you check your environment variables are correctly set?

You can also try installing utop by hand and see if it succeeds.

ghost avatar Nov 10 '14 09:11 ghost

I can reproduce this problem, but only after having run $ opam switch create . 4.08.1 in the directory I am working in. I've run eval (opam env) in fish and still get the same error, even after an opam reinstall utop from the same directory.

If you still need more info on my environment, let me know. I'm happy to help debug this further.

smolck avatar Jan 02 '20 18:01 smolck

Hi, I've encountered the same problem with utop, getting an Fatal error: exception Fl_package_base.No_such_package("utop", "") error.

Searching the keywords Fl_package_base in the source code of utop, I found that the error is triggered when findlib cannot find utop package.

Further looking into findlib, It searches the path specified in /etc/findlib.conf and OCAMLPATH environment.
See findlib user guide.

Invoking opam env in fish shell, I can see the following output. You see OCAMLPATH is not set.

set -gx OPAM_SWITCH_PREFIX ...
set -gx CAML_LD_LIBRARY_PATH ...
set -gx OCAML_TOPLEVEL_PATH ...
builtin -n | /bin/sh -c 'grep -q \'^argparse$\'' 1>/dev/null 2>/dev/null; and set -gx MANPATH ...
set -gx PATH ...

In my (and probably all of you guys) case, the install directory of utop is $HOME/.opam/default/lib/utop. For findlib to locate it correctly, we have to add set -x OCAMLPATH $HOME/.opam/default/lib. After this operation, utop works fine, at least for me.


My environment:

  • Arch linux, 6.6.4-arch1-1, x86_64
  • ocaml 5.0.0-1 from extra/ocaml
  • opam 2.1.5-1 from extra/opam
  • Also ocaml-compiler-libs 5.0.0-1 and ocaml-findlib 1.9.6-2 from arch extra software repository
  • opam init with non-root privilege user
  • Other stuffs installed via opam install utop dune

hehelego avatar Dec 06 '23 05:12 hehelego