简体   繁体   English

OCaml:核心软件包未安装

[英]OCaml: Core package not installing

Following the instructions here for Ubuntu: https://github.com/realworldocaml/book/wiki/Installation-Instructions I've downloaded OCaml and utop which work. 按照此处针对Ubuntu的说明进行操作: https : //github.com/realworldocaml/book/wiki/Installation-Instructions我已经下载了OCaml和utop,它们可以正常工作。 However, the Core module cannot be opened. 但是,无法打开核心模块。 I've downloaded core, async etc as per the instructions. 我已经按照说明下载了核心,异步等。

My edited .ocamlinit file looks like this: 我编辑的.ocamlinit文件如下所示:

(* Added by OPAM. *)
let () =
  try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
  with Not_found -> ()
;;

#use "topfind";;
#thread;;
#camlp4o;;
#require "core.top";;
#require "core.syntax";;

When I open utop I get the message that: 当我打开utop时,我收到以下消息:

No such package: core.top 没有这样的包:core.top

No such package: core.syntax 没有这样的包:core.syntax

If I try to open core by entering "open Core.Std;;" 如果我尝试通过输入“ open Core.Std ;;”来打开Core。 utop returns: "Error: Unbound module Core". utop返回:“错误:核心模块未绑定”。 I'm assuming that the installation instruction are out of date but I haven't been able to find any alternate instructions that fix the issue. 我假设安装说明已经过时,但是我找不到能够解决该问题的其他说明。 Is there something wrong with my .ocamlinit file? 我的.ocamlinit文件有问题吗?

I've downloaded core, async etc as per the instructions. 我已经按照说明下载了核心,异步等。

You need to install them, not only download, make sure, that you did: 您需要安装它们,不仅要下载,还要确保已完成:

 opam install core

If it still doesn't work, then make sure, that you activated your opam environment, with 如果仍然无法正常运行,请确保已使用以下命令激活了opam环境:

 eval `opam config env`

Notice, the backticks (they are not single quotes). 注意,反引号( 不是单引号)。 The command should not print anything. 该命令不应打印任何内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM