rnso
rnso

Reputation: 24613

Cabal install works but cabal list does not find package

I have separately installed cabal in I:\cabal and ghc in I:\ghc folders. I had a previous installation of Haskell-Platform which did not work and I had to uninstall it. But there is a folder named C:\Users\myname\AppData\Roaming\cabal which has many packages (total size 705mb).

Now when I try to install a package, I get error message:

>cabal install easyplot
Resolving dependencies...
Up to date
cabal: installdir is not defined. Set it in your cabal config file or use
--installdir=<path>

So, I do following and it installs ok:

>cabal install easyplot --lib --installdir="C:\Users\myname\AppData\Roaming\cabal"
Resolving dependencies...
Up to date

There is now an easyplot package in folder C:\Users\myname\AppData\Roaming\cabal\packages\hackage.haskell.org

But when I try list command, it is shown as not installed:

>cabal list easyplot
* easyplot
    Synopsis: A tiny plotting library, utilizes gnuplot for plotting.
    Default available version: 1.0
    Installed versions: [ Not installed ]    <<<<<<<<<<<<< NOTE
    Homepage: http://hub.darcs.net/scravy/easyplot
    License:  MIT

Where is the problem and how can it be solved? Thanks for your help.

Upvotes: 3

Views: 1604

Answers (1)

sclv
sclv

Reputation: 38891

Good catch! I opened up an issue on the cabal tracker.

With cabal-install 3.0 and beyond, packages you "install" are put into the store rather than the packagedb, and then made available through tools by being listed in the global ghc environment file. The list command isn't updated to be aware of this workflow, and only lists packages which are in the standard packagedb.

Upvotes: 3

Related Questions