Reputation: 1
I originally had Data.Matrix installed via cabal install --lib matrix
. For some testing, I needed to reinstall the library with profiling, which I did via cabal install --lib matrix --enable-profiling
.
However, now when I try to compile my code, I get this error:
app/MainEquations.hs:16:1: error:
Ambiguous module name ‘Data.Matrix’:
it was found in multiple packages:
matrix-0.3.6.3 matrix-0.3.6.3 matrix-0.3.6.3
|
16 | import Data.Matrix
| ^^^^^^^^^^^^^^^^^^
When I try to look at the instances of matrix that have been installed with ghc-pkg list matrix
, I get:
/home/.ghcup/ghc/9.4.8/lib/ghc-9.4.8/lib/package.conf.d
(no packages)
/home/.ghc/aarch64-darwin-9.4.8/package.conf.d
(no packages)
Due to this, I can't even unregister the duplicate installations. What are other possible solutions?
Upvotes: 0
Views: 65
Reputation: 10685
This is one of many reasons to avoid cabal install --lib
.
The cabal install --lib
command puts things into ~/.ghc/aarch64-darwin-9.4.8/environments/default
(or similar based on your architecture and GHC version). So, removing that should solve some issues.
In the future, I'd suggest sticking to a cabal package or a cabal script.
Upvotes: 3