私はUbuntu 16.04のスタックghciバージョン8で作業しています.HaskellでSystem.Randomをインポートしたいのですが、Cabalを含むかもしれない問題があるようです。私は、システムに問題があると言われますsystem.randomのインストール方法。スタックのバージョン8でキャバルの問題がある可能性があります。
Failed to load interface for ‘System.Random’
Use -v to see a list of the files searched for.
:私はエラーを取得する私はこのウェブサイト上で同様の記事を見てきましたが、彼らは通常、それが原因で古いバージョンであると言うが、私はバージョン8
を使用しています。ランダム。オンラインで見ると、まずCabalをインストールする必要があることがわかりました。
私は
Cabal --version
を入力すると、私は、私はすでにそれを持っている私に指示
cabal-install version 1.22.6.0
using version 1.22.5.0 of the Cabal library
を取得します。私は
sudo apt-get install cabal-install cabal update
を更新しようとすると、だから私は奇妙です
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package cabal
E: Unable to locate package update
を取得します。私はそれを無視して
cabal install random
を通じてとにかくランダムインストールしようとすると、私は
Resolving dependencies...
All the requested packages are already installed:
random-1.1
Use --reinstall if you want to reinstall anyway.
を取得するだから、私はまた、秘密結社のランダムなパッケージを持っているようです。しかし、私はプログラムを読み込むことができません
import System.Random
コマンドです。
編集:私はスタックghciバージョン8.0.1とghciバージョン7.10.3を持っているようです。 System.randomはghciにロードされますが、ghciはスタックされません。
ファイルをスタックにロードしようとすると、次のようなことも起こります。私は
Warning: Couldn't find a component for file target /home/aa/workspace/share/haskell/chenw/hw4/R.hs. Attempting to load anyway.
Configuring GHCi with the following packages:
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/aa/.ghc/ghci.conf
Loaded GHCi configuration from /tmp/ghci19674/ghci-script
を取得
stack ghci R.hs
を入力すると、これは私のスタックのインストールに問題があることを意味していますか?
'sudo apt-get install cabal-install cabal update'がうまくいきません。コマンドは 'cabal update'です。 apt-getとは何の関係もありません。 – Ryan
@ Ryan、私はちょうど "cabal update && cabal install cabal-install"を試みましたが、それでも動作しませんでした。 – domoremath
https://docs.haskellstack.org/en/stable/GUIDE/#adding-dependencies 'stack install'もうまくいくかもしれません。 – Ryan