0

I'm getting this error when trying to install csv using Cabal (OS X):

Resolving dependencies...
Configuring csv-0.1.2...
Building csv-0.1.2...
Failed to install csv-0.1.2
Build log ( /Users/roshnal/.cabal/logs/csv-0.1.2.log ):
Configuring csv-0.1.2...
Building csv-0.1.2...
Preprocessing library csv-0.1.2...
[1 of 1] Compiling Text.CSV         ( Text/CSV.hs, dist/build/Text/CSV.o )

Text/CSV.hs:70:1:
    Bad interface file: /Library/Haskell/ghc-7.10.2-x86_64/lib/parsec-3.1.9/Text/ParserCombinators/Parsec.hi
        Something is amiss; requested module  parsec-3.1.9@parse_8fSmqig53hOL2SEu1k9Tv0:Text.ParserCombinators.Parsec differs from name found in the interface file AwpZ7A1As1bGsDMsWSTZ1J:Text.ParserCombinators.Parsec
cabal: Error: some packages failed to install:
csv-0.1.2 failed during the building phase. The exception was:
ExitFailure 1

I tried updating Cabal, ghc-pkg recache, and as another answer on SO suggested, setting library-profiling to False (in ~/.cabal/config). None of them are working.

Any idea what I can do to install this package? Earlier I have installed other packages using cabal install successfully.

Thanks!

EDIT

As ErirR suggested in his answer, I ran ghc-pkg list and this is the output I got. I don't appear to be having multiple installs of parsec.

/Library/Frameworks/GHC.framework/Versions/7.10.2-x86_64/usr/lib/ghc-7.10.2/package.conf.d
Cabal-1.22.4.0
GLURaw-1.5.0.1
GLUT-2.7.0.1
HTTP-4000.2.20
HUnit-1.2.5.2
ObjectName-1.1.0.0
OpenGL-2.12.0.1
OpenGLRaw-2.5.1.0
QuickCheck-2.8.1
StateVar-1.1.0.0
array-0.5.1.0
async-2.0.2
attoparsec-0.13.0.1
base-4.8.1.0
bin-package-db-0.0.0.0
binary-0.7.5.0
bytestring-0.10.6.0
case-insensitive-1.2.0.4
cgi-3001.2.2.2
containers-0.5.6.2
deepseq-1.4.1.1
directory-1.2.2.0
exceptions-0.8.0.2
fgl-5.5.2.1
filepath-1.4.0.0
ghc-7.10.2
ghc-prim-0.4.0.0
hashable-1.2.3.3
haskeline-0.7.2.1
haskell-src-1.0.2.0
hoopl-3.10.0.2
hpc-0.6.0.2
hscolour-1.23
html-1.0.1.2
integer-gmp-1.0.0.0
mtl-2.2.1
multipart-0.1.2
network-2.6.2.1
network-uri-2.6.0.3
old-locale-1.0.0.7
old-time-1.1.0.3
parallel-3.2.0.6
parsec-3.1.9  // <-- Here's parsec
pretty-1.1.2.0
primitive-0.6
process-1.2.3.0
random-1.1
regex-base-0.93.2
regex-compat-0.95.1
regex-posix-0.95.2
rts-1.0
scientific-0.3.3.8
split-0.2.2
stm-2.4.4
syb-0.5.1
template-haskell-2.10.0.0
terminfo-0.4.0.1
text-1.2.1.3
tf-random-0.5
time-1.5.0.1
transformers-0.4.2.0
transformers-compat-0.4.0.4
unix-2.7.1.0
unordered-containers-0.2.5.1
vector-0.11.0.0
xhtml-3000.2.1
zlib-0.5.4.2
Roshnal
  • 1,284
  • 3
  • 16
  • 39
  • This means your package db is broken in one way or another - if you can't figure out how, you can still nuke the package db and try from the beginning. – user2407038 Aug 07 '16 at 00:57
  • @user2407038 Do you mean that I should remove cabal and try again, or remove everything remotely related to Haskell and start anew? o_O – Roshnal Aug 07 '16 at 15:15
  • Neither, just delete the *package database*. See [here](http://stackoverflow.com/questions/12048352/my-cabal-packages-are-fubar-how-can-i-purge-them-and-start-over) for an explanation of how to do so. – user2407038 Aug 07 '16 at 18:16
  • Oh, okay. Thanks. Actually I removed every trace of Haskell and reinstalled it. Worked :) Good thing I didn't have a huge setup – Roshnal Aug 07 '16 at 20:17

1 Answers1

0

This SO thread might be relevant:

"requested module differs from name found in the interface file"

I would run ghc-pkg list and see if you have multiple installs of the parsec package.

Community
  • 1
  • 1
ErikR
  • 51,541
  • 9
  • 73
  • 124
  • I ran that command and posted the output in my question-- I have only one parsec it seems. And as for the linked question, sorry, I can't figure out which part of it I can use to help me (I'm still new to Haskell/Cabal). – Roshnal Aug 07 '16 at 15:14