In general, this sort of problem happens because you're trying to install package A
, which depends (directly or indirectly) on package B
. However, you already have package C
installed, which also depends on package B
, but the version of B
that C
was linked with won't work with A
.
In some cases you might be able to resolve this sort of problem using:
cabal install --max-backjumps=-1 --reorder-goals <pkg-name>
...but that only works sometimes. A cleaner way to address this sort of thing is to use sandboxes. This will help if you don't need both A
and C
in the same sandbox, or you can re-link C
with a different version of B
. You can do what you want in the sandbox without messing up your main Haskell installation.
If you've written A
or C
yourself, you may need to examine the dependencies of your packages and make adjustments. I'm going translate part of that output into English, to give you an example of how to diagnose dependency problems.
$ cabal install http-enumerator
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: http-enumerator-0.7.3.3 (user goal)
You requested http-enumerator
. The latest version is 0.7.3.3, so I'll try to install that.
next goal: asn1-data (dependency of http-enumerator-0.7.3.3)
Now, http-enumerator-0.7.3.3
requires the package asn1-data
, so let me try to install that.
rejecting: asn1-data-0.7.1, 0.7.0 (conflict: http-enumerator =>
asn1-data>=0.5.1 && <0.7)
The latest two versions of asn1-data
are 0.7.1 and 0.7.0. But http-enumerator-0.7.3.3
requires an earlier version of asn1-data
. So let me try an older version of asn1-data
trying: asn1-data-0.6.1.3
The next available version of asn1-data
is 0.6.1.3.
next goal: text (dependency of asn1-data-0.6.1.3)
But that version of asn1-data
requires text
, so I need to install that first.
rejecting: text-1.2.0.0/installed-18f... (conflict: text =>
bytestring==0.10.4.0/installed-6da..., http-enumerator => bytestring>=0.9.1.4
&& <0.10)
The latest version of text
is 1.2.0.0, but that won't work because it needs a different version of bytestring
than http-enumerator
wants. So let me try an older version of text
.
trying: text-1.2.0.4
next goal: certificate (dependency of http-enumerator-0.7.3.3)
Now, that version of text
requires certificate
, so I need to install that first.
rejecting: certificate-1.3.9, 1.3.8, 1.3.7, 1.3.6, 1.3.5, 1.3.3, 1.3.2, 1.3.1,
1.3.0, 1.2.9, 1.2.8, 1.2.7, 1.2.6, 1.2.5, 1.2.4, 1.2.3, 1.2.2, 1.2.1, 1.2.0
(conflict: http-enumerator => certificate>=1.1 && <1.2)
But all these versions of certificate
are incompatible with http-enumerator
.
trying: certificate-1.1.1
Finally a bit of success. I can use certificate-1.1.1
, and satisfy all of the dependencies of asn1-data
text
.
next goal: tls-extra (dependency of http-enumerator-0.7.3.3)
But http-enumerator-0.7.3.3
also requires tls-extra
.
rejecting: tls-extra-0.6.6, 0.6.5, 0.6.4, 0.6.3, 0.6.1, 0.6.0, 0.5.1, 0.5.0
(conflict: http-enumerator => tls-extra>=0.4.3 && <0.5)
We can't use the latest versions of tls-extra
because they are incompatible with http-enumerator
.
rejecting: tls-extra-0.4.7.1, 0.4.7, 0.4.6.1, 0.4.6, 0.4.5 (conflict:
certificate==1.1.1, tls-extra => certificate>=1.2.0 && <1.3.0)
We can't use these versions of tls-extra
because they are incompatible with certificate
.
rejecting: tls-extra-0.4.4, 0.4.3 (conflict: text==1.2.0.4, tls-extra =>
text>=0.5 && <1.0)
We can't use these versions of tls-extra
because they are incompatible with text
.
rejecting: tls-extra-0.4.2.1, 0.4.2, 0.4.1, 0.4.0, 0.3.1, 0.3.0, 0.2.3, 0.2.2,
0.2.1, 0.2.0, 0.1.9, 0.1.8, 0.1.7, 0.1.6, 0.1.5, 0.1.4, 0.1.3, 0.1.2, 0.1.1,
0.1.0 (conflict: http-enumerator => tls-extra>=0.4.3 && <0.5)
And older versions of tls-extra
aren't compatible with http-enumerator
.
Backjump limit reached (change with --max-backjumps).
I give up!