本文介绍了Xmonad找不到模块XMonad(或其他任何模块)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当xmonad启动,重新启动或重新编译时,我都会收到xmessage:

Whenever xmonad starts, restarts, or is recompiled, I get an xmessage:

xmonad.hs:1:8:
Could not find module `XMonad'
 Perhaps you meant
    Monad (needs flag -package haskell98-2.0.0.2)
    CgMonad (needs flag -package ghc-7.6.3)
    DsMonad (needs flag -package ghc-7.6.3)
 Use -v to see a list of the files searched for

这不会阻止它启动,但是在系统重新引导时,我只会看到对xmonad或xmobar设置的更新.我当前的xmonad.hs只是

This doesn't stop it from starting, but I only see updates to xmonad or xmobar settings on system reboot. My current xmonad.hs is just

import XMonad

main = xmonad defaultConfig

,它仍然会产生错误.导入其他模块的任何尝试都会产生相似的结果.我已经从Arch存储库中同时安装了xmonadxmonad-contrib,所以这些模块应该正确地位于ghc搜索路径中,对吗?我曾尝试像其他来源建议的那样,从Cabal重新安装软件包,但是它变成了一个完整的功能,因此我回到了应该可用的Arch仓库中.从这里到哪里有点茫然;任何帮助将不胜感激.

and it still produces the error. Any attempts to import other modules give similar results. I have both xmonad and xmonad-contrib installed from the Arch repositories, so the modules should be properly in the ghc search path, right? I've tried reinstalling the packages from Cabal like some other sources have suggested, but it turned into a complete snafu, so I went back to the Arch repos, which ought to work. Kind of at a loss for where to go from here; any help would be greatly appreciated.

ghc-pkg list xmonad返回

/usr/lib/ghc-7.6.3/packag.conf.d
    xmonad-0.11
/home/decalis/.ghc/x86_64-linux-7.6.3/package.conf.d

ghc-pkg check输出在此处: http://pastebin.com/BsCPMn8M .看到这一点后,这个问题更加清楚了,但是当pacman从Arch仓库中解析了所有软件包及其依赖项时,我仍然不明白为什么它出现在~/.cabal中.

and ghc-pkg check output is here: http://pastebin.com/BsCPMn8M. The issue is a little clearer after seeing that, but I still don't get why it's looking in ~/.cabal when all of the packages and their dependencies were resolved from the Arch repos by pacman.

推荐答案

在这种情况下,首先要尝试的事情之一是从头开始",即,忘记了您可能已在其中安装的所有本地软件包.过去.

In cases like this one of the first things to try is to "start from scratch", i.e. forget about all the local packages that you might have installed in the past.

为此,请擦除(或重命名/移动)ghc的软件包数据库,该数据库位于~/.ghc/$arch-$os-$ghcver(例如~/.ghc/i386-linux-7.6.3)下.或完全删除~/.ghc.

To do this, wipe (or rename/move) ghc's package database, which is under ~/.ghc/$arch-$os-$ghcver (such as ~/.ghc/i386-linux-7.6.3). Or just remove ~/.ghc altogether.

这篇关于Xmonad找不到模块XMonad(或其他任何模块)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 17:03