haskell cabal sandbox如何安装软件包? [英] haskell cabal sandbox how to install packages?
问题描述
我希望有人告诉我在沙箱中安装 gloss-examples
所需的步骤及其所有依赖项。
这是我尝试做的事情:
I wish if someone tells me the steps required to install gloss-examples
in a sandbox along with all its dependencies.
Here is what I tried to do:
I downloaded the gloss-examples
package from hackage.
当我运行命令时,更改为〜/ gloss / gloss-examples-1.9.4.1
When I ran the command, after changing into the ~/gloss/gloss-examples-1.9.4.1
~/gloss/gloss-examples-1.9.4.1$cabal sandbox init
成功,所以我发出了命令
it succeeded, so I issued the command
~/gloss/gloss-examples-1.9.4.1$cabal install --only-dependencies
但是后来我得到了以下内容错误:
but then I got the following errors:
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: gloss-examples-1.9.4.1 (user goal)
next goal: base (dependency of gloss-examples-1.9.4.1)
rejecting: base-4.5.0.0/installed-c8e... (conflict: gloss-examples =>
base==4.8.*)
rejecting: base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1,
base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0,
base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2,
base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0, base-3.0.3.2,
base-3.0.3.1 (constraint from non-upgradeable package requires installed
instance)
Dependency tree exhaustively searched.
Note: when using a sandbox, all packages are required to have consistent
dependencies. Try reinstalling/unregistering the offending packages or
recreating the sandbox.
如何安装此软件包光泽示例
及其所有依赖项仅在沙箱目录中?我想我知道,cabal sandbox允许您安装所有依赖项(某些或全部与全局安装的软件包冲突)的任意软件包安装在单独的目录中。
这可能吗?
我想我缺少了一些东西。这是阴谋沙箱的正确用例吗?
看到以下内容
How do I install this package gloss-examples
and all its dependencies in the sandbox directory only? I think I understand that cabal sandbox allows you to install any arbitrary package with all dependencies (some or all them conflicting with globally installed packages) installed in a separate directory.
Is this even possible?
I think I am missing something. Is this a right use-case for cabal sandbox?
Seeing the following
注意:使用沙箱时,所有软件包都必须具有一致的依赖性。
冲突的依赖项
和不一致的依赖项$ c之间是否有区别? $ c>?
我尝试了许多教程,包括此,但无法理解如何使用阴谋沙箱。
I tried many tutorials including this but could not understand how to use cabal sandbox.
推荐答案
它在我看来,您下载的光泽示例
版本与您的 base
库版本不兼容。有两种方法可以解决此问题:
It appears to me that you have downloaded a version of gloss-examples
that is not compatible with your version of the base
library. There are two ways to fix this:
-
下载与您的<$ c兼容的版本(可能是较旧的版本) $ c> base 库。 关于Hackage的软件包的内容页面在顶部附近列出了很多可用版本。可能也可以使用
取刺
来做到这一点—我不确定。
Download a version (presumably an older one) that is compatible with your
base
library. The contents page for the package on Hackage has a long list of available versions near the top. It may also be possible to usecabal fetch
to do this—I'm not sure.
升级GHC以获得更新的基础
。您通常不能在不升级GHC的情况下升级 base
。
Upgrade GHC to get a newer base
. You generally cannot upgrade base
without upgrading GHC.
这篇关于haskell cabal sandbox如何安装软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!