简体   繁体   English

堆栈未安装正确版本的Haskell基库

[英]Stack doesn't install correct version of Haskell base library

I am fairly new to Haskell. 我对Haskell相当陌生。 I am trying to build a project downloaded from GitHub using stack. 我正在尝试使用堆栈构建从GitHub下载的项目。 When I try to run stack solver , I get this output: 当我尝试运行stack solver ,得到以下输出:

cabal: Could not resolve dependencies:
trying: deeplearning-hs-0.1.0.2 (user goal)
next goal: base (dependency of deeplearning-hs-0.1.0.2)
rejecting: base-4.8.1.0/installed-075... (conflict: deeplearning-hs =>
base>=4.6 && <4.7)
rejecting: base-4.8.1.0 (global constraint requires installed instance)
rejecting: base-4.8.0.0, 4.7.0.2, 4.7.0.1, 4.7.0.0, 4.6.0.1, 4.6.0.0, 4.5.1.0,
4.5.0.0, 4.4.1.0, 4.4.0.0, 4.3.1.0, 4.3.0.0, 4.2.0.2, 4.2.0.1, 4.2.0.0,
4.1.0.0, 4.0.0.0, 3.0.3.2, 3.0.3.1 (global constraint requires ==4.8.1.0)
Dependency tree exhaustively searched.

The issue seems to be this "global constraint" but I'm not sure where that's coming from. 问题似乎是这种“全局约束”,但是我不确定这是从哪里来的。 I have looked through my global .cabal files and they are pretty generic--they don't seem to specify the versions of anything. 我查看了我的全局.cabal文件,它们非常通用-它们似乎未指定任何版本。

base is a library bundled with GHC (the compiler). base是与GHC(编译器)捆绑在一起的库。 For each GHC version, there is one base version. 对于每个GHC版本,都有一个base版本。

To install deeplearning-hs , seems you need to satisfy base == 4.6.* constraint, ie have GHC version 7.6. 要安装deeplearning-hs ,您似乎需要满足base == 4.6.*约束,即具有GHC版本7.6。 Unfortunately you cannot install GHC older then 7.8 with stack AFAIK. 不幸的是,您无法使用堆栈AFAIK安装早于7.8版本的GHC。

You can play with it locally if you change base >=4.6 && <4.7 bounds to base >= 4.6 && <4.8 , ie allow base coming with GHC 7.8 for example. 你可以,如果你改变它在本地播放base >=4.6 && <4.7范围到base >= 4.6 && <4.8 ,即允许base与GHC 7.8来自例如。 Note, you shouldn't remove dependencies, you should try to relax the constraints (ie version bounds). 注意,您不应该删除依赖项,而应尝试放松约束(即版本边界)。 I tried locally, and the package seems to compile with GHC 7.8. 我在本地尝试过,该软件包似乎可以与GHC 7.8一起编译。 It doesn't compile with GHC 7.10 as Foldable-Traversal-Proposal affects this package. 它不能与GHC 7.10一起编译,因为Foldable-Traversal-Proposal会影响此软件包。

IMHO best way is to contact the maintainer and ask for upgrade, or even better submit a pull request, as source seems to be on GitHub ( which I did ). 恕我直言,最好的方法是联系维护者并要求升级,甚至更好地提交拉取请求,因为源似乎在GitHub上( 我做到了 )。

PS I relaxed the bounds on Hackage , so you can install it with GHC 7.8 without worries now. PS 我放松了Hackage的范围 ,因此您现在就可以与GHC 7.8一起安装它了。

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

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