Haskell找不到模块“系统" [英] Haskell Could not find module `System'

查看:66
本文介绍了Haskell找不到模块“系统"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Haskell的新手,对其包装有疑问.

I'm new with Haskell and have trouble with its package.

我想导入System.Random,但是

I want to import System.Random but

找不到模块`System.Random'

Could not find module `System.Random'

然后我尝试导入System,但是

Then I tried to import System but

找不到模块系统".

Could not find module `System'.

它是隐藏软件包"haskell98-2.0.0.0"的成员.

It is a member of the hidden package `haskell98-2.0.0.0'.


我试图搜索此问题,但那些解决方案仍然无法正常工作.


I tried to search this problem, but those solutions still don't work.

说,我试图使用MacPort在我的Mac OS X上安装cabal,但是

As this said, I tried to install cabal on my Mac OS X using MacPort, but

错误:未安装以下依赖项:ghc 错误:处理期间遇到状态1.

Error: The following dependencies were not installed: ghc Error: Status 1 encountered during processing.

我已经安装了 Haskell平台,并且可以在命令行中使用ghci. GHCi,版本7.2.1

I have installed Haskell Platform and can use ghci in command-line. GHCi, version 7.2.1

然后我尝试将ghc-pkg expose haskell98-2.0.0.0用作这一个说.

但是这次,我什至无法运行ghci.

But this time, I can't even run ghci.

最高级别:

前奏"的歧义接口:

在多个软件包中找到它:基础haskell98-2.0.0.0

it was found in multiple packages: base haskell98-2.0.0.0


那么,不使用阴谋集团怎么办?


So, what can I do without using cabal?

推荐答案

random软件包,即否从7.2.1版起已不再包含在GHC中.

The System.Random module belongs to the random package, which is no longer included with GHC as of version 7.2.1.

由于我不熟悉Mac OS X,所以我不确定该如何解决Cabal问题,但建议您先使它起作用.然后,使用Cabal轻松安装random.

I'm not sure what to do about your Cabal problem, as I'm not familiar with Mac OS X, but I'd recommend getting that to work first. Installing random should then be trivial using Cabal.

作为一种可能的解决方法,您可能要考虑使用旧版本的GHC.

As a possible workaround, you might want to consider using an older version of GHC.

这篇关于Haskell找不到模块“系统"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆