QuickCheck即使安装了最新版本也不起作用

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

尝试在Windows上使用Haskell和QuickCheck。命令

cabal install QuickCheck

返回

Up to date
Warning: You asked to install executables, but there are no executables in
target: QuickCheck. Perhaps you want to use --lib to install libraries
instead. 

显然,它确实安装了,但是当我运行导入Test.QuickCheck的脚本时,出现以下错误消息:

Could not find module `Test.QuickCheck'

注意:我尝试了所有可以在stackoverflow上找到的建议解决方案,包括Could not find module ‘Test.QuickCheck’ on Windows,但没有一个解决方案可以帮助我解决问题。因此,请仅在确定可行的情况下发布解决方案。

同样,如果有帮助,我可以根据在haskell platform上找到的说明安装所有组件

我安装QuickCheck的方法是通过键入命令

cabal install QuickCheck

在我所看到的每个地方,我只会看到使用“堆栈”命令的解决方案,但我不知道它是什么,也不对我有用。

编辑:我忘了提及我已经尝试了错误消息告诉我的内容,即输入命令

cabal install --lib QuickCheck

但是此命令再次返回

Up to date

因此无法解决我的问题。

更新:

[我尝试使用cabal init --interactive初始化项目,在[.cabal]文件中将QuickCheck添加到build-depends,并将import Test.QuickCheck添加到我的Main.hs。当我运行ghc Main.hs时,仍然出现相同的错误Could not find module `Test.QuickCheck'

haskell quickcheck
1个回答
0
投票

安装库时,您需要使用--lib标志,使用完整的命令:

cabal install --lib QuickCheck

告诉您使用--lib的消息被认为不足,并且在下一版的Cabal中已更新为:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: Installation might not be completed as desired! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Without flags, the command "cabal install" doesn't expose libraries in a
usable manner. You might have wanted to run "cabal install --lib QuickCheck".

我建议您在StackOverflow上查看其他答案,其中包括更多背景信息。例如:Whenever I try to install a new package on Cabal, it tries and fails to install a previously failed install

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