나는 스택 ghci 버전 8 우분투 16.04에서 일하고있다. 하스켈에서 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
명령과 함께 프로그램을로드 할 수 없습니다.
EDIT : ghci 버전 8.0.1 및 ghci 버전 7.10.3이 스택에있는 것 같습니다. System.random은 ghci에서로드되지만 ghci는 스택되지 않습니다.
스택에 파일을로드하려고하면 다음과 같은 오류가 발생합니다.
stack ghci R.hs
입력 나는
이
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
이 내 스택의 설치에 문제가 뜻거야?
'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