'Problems with installing pandoc
I'm trying to install pandoc on a new Ubuntu machine. First, I installed the haskell platform. Then I installed pandoc with the command cabal install pandoc, but then got the following error message. How can I fix it?
[1 of 1] Compiling Data.Ipynb ( src/Data/Ipynb.hs, dist/build/Data/Ipynb.o )
src/Data/Ipynb.hs:152:23: error:
• No instance for (Ord Value)
arising from the 'deriving' clause of a data type declaration
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
• When deriving the instance for (Ord JSONMeta)
|
152 | deriving (Show, Eq, Ord, Generic, Semigroup, Monoid, FromJSON)
| ^^^
src/Data/Ipynb.hs:479:23: error:
• No instance for (Ord Value)
arising from the first field of ‘JsonData’ (type ‘Value’)
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
• When deriving the instance for (Ord MimeData)
|
479 | deriving (Show, Eq, Ord, Generic)
| ^^^
Failed to install ipynb-0.2
cabal: Error: some packages failed to install:
ipynb-0.2-12lvW0D0287FL7WAB5JQxT failed during the building phase. The
exception was:
ExitFailure 1
pandoc-2.17.0.1-5yDcj1RH0pT4FRdq4hDaRb depends on pandoc-2.17.0.1 which failed
to install.
Solution 1:[1]
You seem to be using an ancient version of the aeson package. Up to verion 1.5.1.0, its Value type did not have an Ord instance. But the ipynb library needs that instance, so it should have the constraint aeson >=1.5.2 in its .cabal file – but it doesn't. (You may want to file a pull request about this.)
For now, you can manually use
cabal install pandoc --constraint 'aeson>=1.5.2'
(This may incur having to re-install lots of packages, or other problems!)
Solution 2:[2]
There's the easy way, if you don't need the newest version:
sudo apt install pandoc
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | declension |
