简体   繁体   English

使用OPAM安装Coq软件包

[英]Installing packages for Coq using OPAM

I am trying to install a coq-contrib package OPAM. 我正在尝试安装coq-contrib软件包OPAM。 I am still new to OPAM and Coq. 我还是OPAM和Coq的新手。 I was using OPAM 1.2.2 and was getting this: 我正在使用OPAM 1.2.2,并且得到了以下信息:

$ opam install coq-graph-basics
Your request can't be satisfied:
- No package matches coq-graph-basics

No solution found, exiting

even though I could see it when running 即使我可以在跑步时看到它

opam search coq-

After reading this issue https://github.com/ocaml/opam/issues/2526 , I tried upgrading to OPAM 2.0.0. 阅读此问题https://github.com/ocaml/opam/issues/2526后 ,我尝试升级到OPAM 2.0.0。

This is what I got this time when trying to install the package: 这是我这次尝试安装软件包时得到的:

$ opam install coq-graph-basics
The following dependencies couldn't be met:
- coq-graph-basics → coq < 8.6~
not available because the package is pinned to version 8.7.2

No solution found, exiting

I am not sure what I am doing wrong here. 我不确定我在做什么错。 Does anyone know what these messages mean? 有人知道这些消息是什么意思吗? What am I missing? 我想念什么?

Thanks 谢谢

Your error means that opam knows a package coq-graph-basics , but it is not compatible with recent versions of Coq (>= 8.6), and your version is recent (8.7.2). 您的错误意味着opam知道一个软件包coq-graph-basics ,但是它与Coq的最新版本(> = 8.6)不兼容,而您的版本是最新的(8.7.2)。

One solution could be to downgrade Coq. 一种解决方案是降级Coq。 Here, this is not proposed, because your Coq package is "pinned" to version 8.7.2, which means you told opam not to change its version. 在这里,不建议这样做,因为您的Coq软件包已“固定”到版本8.7.2,这意味着您告诉opam不要更改其版本。 If you unpin it, with opam unpin coq , you would be proposed to downgrade Coq. 如果您取消固定,则用opam unpin coq ,建议您降级Coq。 But this is not the way to go here. 但这不是要走的路。

In your case, you rather need a newer version of the package that is compatible with recent versions of Coq. 在您的情况下,您宁愿需要与Coq的最新版本兼容的软件包的较新版本。 As @AntonTrunov points out in his comment, you can tell opam to look at other repositories than the default one. 正如@AntonTrunov在其评论中指出的那样,您可以告诉opam查看其他存储库,而不是默认存储库。

The commands: 命令:

opam repo add coq-released https://coq.inria.fr/opam/released
opam update

add a repository with recent versions of most Coq packages, and in particular a recent version of coq-graph-basics . 添加一个存储库,其中包含大多数Coq软件包的最新版本,尤其是最新版本的coq-graph-basics

EDIT: Coq packages are distributed using three repositories (one of them being "coq-released"). 编辑:使用三个存储库分发了Coq程序包(其中一个被“ coq发布”)。 The repositories are presented here . 存储库在此处介绍。

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

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