gpt4 book ai didi

macos - 无法找到 cabal 安装的软件包

转载 作者:行者123 更新时间:2023-12-04 05:17:32 26 4
gpt4 key购买 nike

我不知所措。我使用 OS X 10.8.2。

我能找到的唯一引用是:

  • 4.1 I just installed packages, but now the packages are not found`

  • This happens when you install a package globally, and the previous
    packages were installed locally. Note that cabal-install install
    locally by default and the "runhaskell Setup" commands install
    globally by default.


  • 默认情况下,cabal 设置为在本地安装。我没有改变这一点。 Haskell 已在全局安装。
    $ cabal install pointfree
    Resolving dependencies...
    Configuring pointfree-1.0.4.3...
    Building pointfree-1.0.4.3...
    Preprocessing executable 'pointfree' for pointfree-1.0.4.3...
    [1 of 7] Compiling Plugin.Pl.Common ( Plugin/Pl/Common.hs, dist/build/pointfree/pointfree-tmp/Plugin/Pl/Common.o )
    [2 of 7] Compiling Plugin.Pl.Parser ( Plugin/Pl/Parser.hs, dist/build/pointfree/pointfree-tmp/Plugin/Pl/Parser.o )
    [3 of 7] Compiling Plugin.Pl.PrettyPrinter ( Plugin/Pl/PrettyPrinter.hs, dist/build/pointfree/pointfree-tmp/Plugin/Pl/PrettyPrinter.o )
    [4 of 7] Compiling Plugin.Pl.Transform ( Plugin/Pl/Transform.hs, dist/build/pointfree/pointfree-tmp/Plugin/Pl/Transform.o )
    [5 of 7] Compiling Plugin.Pl.Rules ( Plugin/Pl/Rules.hs, dist/build/pointfree/pointfree-tmp/Plugin/Pl/Rules.o )
    [6 of 7] Compiling Plugin.Pl.Optimize ( Plugin/Pl/Optimize.hs, dist/build/pointfree/pointfree-tmp/Plugin/Pl/Optimize.o )
    [7 of 7] Compiling Main ( Main.hs, dist/build/pointfree/pointfree-tmp/Main.o )
    Linking dist/build/pointfree/pointfree ...
    Warning: No documentation was generated as this package does not contain a
    library. Perhaps you want to use the --executables flag.
    Installing executable(s) in
    /Users/beoliver/Library/Haskell/ghc-7.4.2/lib/pointfree-1.0.4.3/bin
    Installed pointfree-1.0.4.3
    Updating documentation index /Users/beoliver/Library/Haskell/doc/index.html

    $ cat ~/.bash_profile
    export PATH="$HOME/Library/Haskell/bin:$PATH"


    $ ls -l ~/Library/Haskell/bin/
    total 24
    lrwxr-xr-x 1 beoliver staff 49 Dec 28 16:06 cabal -> ../ghc-7.4.2/lib/cabal-install-1.16.0.2/bin/cabal
    lrwxr-xr-x 1 beoliver staff 48 Dec 28 19:52 pointfree -> ../ghc-7.4.2/lib/pointfree-1.0.4.3/bin/pointfree
    -rw-r--r-- 1 beoliver staff 66 Dec 28 19:53 x

    x 是奇数...
    $ cat ~/Library/Haskell/bin/x
    (line 1, column 5):
    unexpected "+"
    expecting space or simple term



    我查了 ghc-pkg list但它不存在。所以看看它是否与 user包。
    $ ls ~/Library/Haskell/ghc-7.4.2/lib/
    Cabal-1.16.0.3 cabal-install-1.16.0.2 pointfree-1.0.4.3

    $ file pointfree-1.0.4.3/bin/pointfree
    pointfree-1.0.4.3/bin/pointfree: Mach-O 64-bit executable x86_64

    $ ghc-pkg list --user
    /Users/beoliver/.ghc/x86_64-darwin-7.4.2/package.conf.d
    Cabal-1.16.0.3
    $ cabal --version
    cabal-install version 1.16.0.2
    using version 1.16.0.3 of the Cabal library

    我在这里错过了一面旗帜吗?我还需要构建它吗?
    $ ghc-pkg check
    Warning: haddock-interfaces: /Library/Haskell/ghc-7.4.2/lib/haskell-platform-2012.4.0.0/doc/html/haskell-platform.haddock doesn't exist or isn't a file
    Warning: haddock-html: /Library/Haskell/ghc-7.4.2/lib/haskell-platform-2012.4.0.0/doc/html doesn't exist or isn't a directory
    Warning: haddock-interfaces: /Library/Haskell/ghc-7.4.2/lib/GLUT-2.1.2.1/doc/html/GLUT.haddock doesn't exist or isn't a file

    最佳答案

    I check ghc-pkg list but it is not there.


    ghc-pkg只知道并关心已安装的库。 pointfree是一个没有附带库的可执行文件,所以 ghc-pkg不知道。

    $HOME/Library/Haskell/bin在您的 PATH ,并且可执行文件链接到那里,您可以简单地从命令行运行它
    $ pointfree "\f x y -> f y x"
    flip

    (或者类似的东西,我已经很久没有玩过 pointfree 了)。

    the x is odd...



    这看起来像是来自 parsec 的解析错误消息.不过,我不知道是什么将它写入该文件。

    $ ghc-pkg check
    Warning: haddock-interfaces: /Library/Haskell/ghc-7.4.2/lib/haskell-platform-2012.4.0.0/doc/html/haskell-platform.haddock doesn't exist or isn't a file
    Warning: haddock-html: /Library/Haskell/ghc-7.4.2/lib/haskell-platform-2012.4.0.0/doc/html doesn't exist or isn't a directory
    Warning: haddock-interfaces: /Library/Haskell/ghc-7.4.2/lib/GLUT-2.1.2.1/doc/html/GLUT.haddock doesn't exist or isn't a file

    似乎有什么东西践踏了你的黑线鳕,或者它们从一开始就没有正确安装。这可能表明存在实际问题,但如果您不想要本地文档,则可以忽略它。

    关于macos - 无法找到 cabal 安装的软件包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14074639/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com