Cabal:无法安装特定版本的软件包(显示消息“只能使用已安装的实例”)

问题描述 投票:0回答:1

我一直在尝试安装一些软件包:

PS C:\Users\Neo> cabal install template-haskell-2.15.0.0
Resolving dependencies...
cabal-3.6.2.0.exe: Could not resolve dependencies:
[__0] next goal: template-haskell (user goal)
[__0] rejecting: template-haskell-2.19.0.0, template-haskell-2.18.0.0,
template-haskell-2.17.0.0, template-haskell-2.16.0.0 (constraint from user
target requires ==2.15.0.0)
[__0] rejecting: template-haskell-2.15.0.0 (only already installed instances
can be used)
[__0] rejecting: template-haskell-2.14.0.0, template-haskell-2.13.0.0,
template-haskell-2.12.0.0, template-haskell-2.11.1.0,
template-haskell-2.11.0.0, template-haskell-2.10.0.0,
template-haskell-2.9.0.0, template-haskell-2.8.0.0, template-haskell-2.7.0.0,
template-haskell-2.6.0.0, template-haskell-2.5.0.0, template-haskell-2.4.0.1,
template-haskell-2.4.0.0, template-haskell-2.3.0.1, template-haskell-2.3.0.0,
template-haskell-2.2.0.0 (constraint from user target requires ==2.15.0.0)
[__0] fail (backjumping, conflict set: template-haskell)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: template-haskell

“只能使用已安装的实例”消息到底是什么意思?

haskell cabal
1个回答
1
投票

base
类似,但与大多数其他软件包不同,
template-haskell
不可重新安装,基本上意味着它与您的 GHC 版本相关联,无法单独安装、升级或降级。 Cabal 的源代码 具有此类软件包的完整列表。这就是“仅已安装的实例 可以使用”的意思。(对于未来的读者,Cabal 的新版本会说“来自不可升级包的约束需要安装实例”。)

理想情况下,您尝试安装的软件包应该更新为与较新版本的 GHC 配合使用,但如果您确实需要降级到

template-haskell-2.15.0.0

,那么您可以通过降级到 GHC 8.8.4 来实现。 GHC Wiki 上的
GHC 启动库版本历史记录有一个表,其中列出了哪个 GHC 版本对应于哪个库版本。 (请注意,除了不可重新安装的库之外,还有很多 GHC 启动库。)

© www.soinside.com 2019 - 2024. All rights reserved.